1.尝试运行models/research/object_detection/目录下的.py文件时出现:
ModuleNotFoundError: No module named 'object_detection'
需在models/research/目录下执行:
python setup.py install
出现ModuleNotFoundError: No module named 'pycocotools'
执行:
conda install pycocotools
出现 ImportError: No module named 'nets'
需在models/research/slim目录下执行:
python setup.py install
2.训练中出现的问题
① raise ValueError('First step cannot be zero.')ValueError: First step cannot be zero.
删除预训练模型Config中的下列代码
|
1 2 3 4 |
|
②Assertion failed: [maximum box coordinate value is larger than 1.100000: ] [1.1435889]
问题:标注数据,超出了图像的长宽
解决方法:在生成标注数据时,将x,y坐标进行截断
3.出现 ValueError: Tried to convert 't' to a tensor and failed. Error: Argument must be a dense tensor: range(0, 3) - got shape [3], but wanted [].错误
找到错误提示中的learning_schedules.py
将其167~19行
rate_index = tf.reduce_max(tf.where(tf.greater_equal(global_step, boundaries),
range(num_boundaries),
[0] * num_boundaries))
修改成:
rate_index = tf.reduce_max(tf.where(tf.greater_equal(global_step, boundaries),
list(range(num_boundaries)),
[0] * num_boundaries)
本文针对在使用TensorFlow Object Detection API进行模型训练时遇到的常见问题提供了详细的解决方案,包括ModuleNotFoundError、ImportError等模块缺失错误,训练配置错误导致的学习率设置问题,以及标注数据坐标超出图像范围的错误。

877

被折叠的 条评论
为什么被折叠?



