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: Can't get attribute 'SPPF' on <module 'models.common' from '/home/zkx/graduation/Alpha-IoU/models/common.py'> #4

Closed
LoveYueForever opened this issue Nov 12, 2021 · 5 comments

Comments

@LoveYueForever
Copy link

image
Thanks for your excellent project. When I test the trained model, I find this error. In the file models/common.py, I can't find the class SSPF. Could you please tell me the cause of this problem? Thank you very much !

@LoveYueForever
Copy link
Author

image Thanks for your excellent project. When I test the trained model, I find this error. In the file models/common.py, I can't find the class SSPF. Could you please tell me the cause of this problem? Thank you very much !

Sorry, It's class SPPF

@NBStephens
Copy link

This is because YOLOv5 updated to v6.0 and the author has left the automatic download intact. See this issue on Yolov5 page (ultralytics/yolov5#5175).

You essentially have to wget the v5.0 weights yourself (https://github.com/ultralytics/yolov5/releases/tag/v5.0)

wget https://github.com/ultralytics/yolov5/releases/download/v5.0/yolov5m.pt

@Jacobi93
Copy link
Owner

@NBStephens Thx so much for your answer. This (ultralytics/yolov5#5175) should be exactly the same issue.
@LoveYueForever Thx so much for your interest in our repo. Actually, we use YOLOv5 in version 4.0 as mentioned in the README.md (version 5.0 may also be fine, but as discussed in ultralytics/yolov5#5175, version 6.0 is inconsistent with earlier versions (e.g., 4.0 and 5.0).

You should be able to run detect.py without bugs if you download our repo and use our uploaded weights (an example is shown below). If you wanna test other pre-trained models, plz remember to use some version earlier than version 6.0.
python detect.py --source inference/images --weights 'runs/train/voc_yolov5s_iou/weights/best.pt' --conf 0.25

It is a simple yet effective method so that you are welcome to apply our methods in other models and repos following the function 'bbox_alpha_iou' in utils/loss.py.

@LoveYueForever
Copy link
Author

This is because YOLOv5 updated to v6.0 and the author has left the automatic download intact. See this issue on Yolov5 page (ultralytics/yolov5#5175).

You essentially have to wget the v5.0 weights yourself (https://github.com/ultralytics/yolov5/releases/tag/v5.0)

wget https://github.com/ultralytics/yolov5/releases/download/v5.0/yolov5m.pt

Thanks very much for answer.

@LoveYueForever
Copy link
Author

@NBStephens Thx so much for your answer. This (ultralytics/yolov5#5175) should be exactly the same issue. @LoveYueForever Thx so much for your interest in our repo. Actually, we use YOLOv5 in version 4.0 as mentioned in the README.md (version 5.0 may also be fine, but as discussed in ultralytics/yolov5#5175, version 6.0 is inconsistent with earlier versions (e.g., 4.0 and 5.0).

You should be able to run detect.py without bugs if you download our repo and use our uploaded weights (an example is shown below). If you wanna test other pre-trained models, plz remember to use some version earlier than version 6.0. python detect.py --source inference/images --weights 'runs/train/voc_yolov5s_iou/weights/best.pt' --conf 0.25

It is a simple yet effective method so that you are welcome to apply our methods in other models and repos following the function 'bbox_alpha_iou' in utils/loss.py.

Thank you very much for your answer. The problem has been solved.

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