微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

类型错误:“NoneType”类型的对象没有 len()、图像 ai 和 yolov3

如何解决类型错误:“NoneType”类型的对象没有 len()、图像 ai 和 yolov3

谷歌搜索错误,我看到有人发布关于修复我的注释的帖子,但这意味着什么。就像我不明白该怎么做一样,我可以看到它“评估了 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"])。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。