问题描述
谷歌搜索错误,我看到有人发布关于修复我的注释的帖子,但这意味着什么。就像我不明白该怎么做一样,我可以看到它“评估了 0 个样本”,这可能是问题所在。除了明显与不同的图像相关之外,验证和训练文件中的注释和图像之间没有区别。感谢您的帮助,谢谢:)
Average IoU for 9 anchors: 1.00
Anchor Boxes generated.
Detection configuration saved in train for head and shoulders asc\json\detection_config.json
Evaluating over 0 samples taken from train for head and shoulders asc\validation
Training over 7 samples given at train for head and shoulders asc\train
Some labels have no annotations! Please revise the list of labels in your configuration.
Training on: None
Training with Batch Size: 16
Traceback (most recent call last):
File "E:\projects\2\image recognition.py",line 7,in <module>
trainer.trainModel()
File "C:\Users\Stingeyal\AppData\Roaming\Python\python38\site-packages\imageai\Detection\Custom\__init__.py",line 224,in trainModel
print("Number of Training Samples: ",len(train_ints))
TypeError: object of type 'nonetype' has no len()
解决方法
我在尝试本教程时遇到了同样的问题 (https://medium.com/deepquestai/train-object-detection-ai-with-6-lines-of-code-6d087063f6ff)
然后我将第 6 行 (object_names_array = ["hololens","google-glass","oculus"]
) 中的代码更改为我在制作训练图像时使用的名称 (trainer.setTrainConfig(object_names_array=["rectangle","square","rhombus"]
)。