AttributeError: 'Model' object has no attribute 'names'
YongpeiZhu opened this issue · 0 comments
YongpeiZhu commented
I also meet the error when I run yolo5s:
Traceback (most recent call last):
File "test.py", line 365, in
test(opt.data,
File "test.py", line 97, in test
names = {k: v for k, v in enumerate(model.names if hasattr(model, 'names') else model.module.names)}
File "/home/ubuntu/anaconda3/envs/yolov5/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1207, in getattr
raise AttributeError("'{}' object has no attribute '{}'".format(
AttributeError: 'Model' object has no attribute 'names'
I already use the command export PYTHONPATH=$PWD.