Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'function' object has no attribute 'names' #22

Open
DL-Alva opened this issue Nov 5, 2020 · 2 comments
Open

AttributeError: 'function' object has no attribute 'names' #22

DL-Alva opened this issue Nov 5, 2020 · 2 comments

Comments

@DL-Alva
Copy link

DL-Alva commented Nov 5, 2020

您好,非常感谢您提供的项目代码。最近我使用训练好的模型进行检测时,显示如下报错:
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 也没找到答案,请问您知道这是什么原因吗?期待您的回复。☺

@DataXujing
Copy link
Owner

检查你的检测类别名称的修改,是否正确,这句error提示在获取所有的检测类别的label name时出现了错误

@peidongha
Copy link

您好,我遇到了同样的问题,是否解决了这个问题呐,麻烦您回复一下,谢谢了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants