您好,非常感谢您提供的项目代码。最近我使用训练好的模型进行检测时,显示如下报错:
Traceback (most recent call last):
File "detect.py", line 164, in
detect()
File "detect.py", line 48, in detect
names = model.names if hasattr(model, 'names') else model.modules.names
AttributeError: 'function' object has no attribute 'names'
您好,非常感谢您提供的项目代码。最近我使用训练好的模型进行检测时,显示如下报错: Traceback (most recent call last): File "detect.py", line 164, in
detect()
File "detect.py", line 48, in detect
names = model.names if hasattr(model, 'names') else model.modules.names
AttributeError: 'function' object has no attribute 'names'
但是前几天我用另外一个数据集做训练和检测时,没有发现类似的问题,我在yaml中把相关内容都改成了符合我数据集的参数。而且我发现models/yolov5x.yaml 和 models/score/yolov5x.yaml这两个文件中的参数不一样。我参考了issue9 也没找到答案,请问您知道这是什么原因吗?期待您的回复。☺