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: 'YoloHead' object has no attribute 'anchors' #1434

Closed
gsrujana opened this issue Aug 30, 2023 · 3 comments
Closed

AttributeError: 'YoloHead' object has no attribute 'anchors' #1434

gsrujana opened this issue Aug 30, 2023 · 3 comments
Labels
🐛 Bug Something isn't working Planned The fix is on the roadmap

Comments

@gsrujana
Copy link

🐛 Describe the bug

Getting this error when trying to fine-tune yolox model on version 3.2.0. This is issue with any of the yolox - l,s etc. No issues on using version 3.1.3.
[2023-08-30 21:02:03] INFO - checkpoint_utils.py - Successfully loaded pretrained weights for architecture yolox_l Traceback (most recent call last): File "/home/ubuntu/EFSDrive/Users/sgattupa/workspace/cxrs_greeniq/third_party/training_yoloX/train.py", line 40, in <module> model = models.get(MODEL_ARCH, num_classes=107, pretrained_weights="coco").to(DEVICE) File "/opt/conda/envs/pytorch/lib/python3.9/site-packages/super_gradients/training/models/model_factory.py", line 222, in get net = instantiate_model(model_name, arch_params, checkpoint_num_classes, pretrained_weights, download_required_code) File "/opt/conda/envs/pytorch/lib/python3.9/site-packages/super_gradients/training/models/model_factory.py", line 162, in instantiate_model net.replace_head(new_num_classes=num_classes_new_head) File "/opt/conda/envs/pytorch/lib/python3.9/site-packages/super_gradients/training/models/detection_models/yolo_base.py", line 684, in replace_head stride=self._head.anchors.stride, File "/opt/conda/envs/pytorch/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1207, in __getattr__ raise AttributeError("'{}' object has no attribute '{}'".format( AttributeError: 'YoloHead' object has no attribute 'anchors'

Versions

3.2.0

@Louis-Dupont
Copy link
Contributor

Hi @gsrujana ,
This is a known issue that was recently addressed in this PR #1411
It will be part of the next release 3.2.1 which should come pretty soon

@Louis-Dupont Louis-Dupont added the 🐛 Bug Something isn't working label Aug 30, 2023
@gsrujana
Copy link
Author

gsrujana commented Aug 30, 2023

I see. For now, I added “self.anchors = anchors” in ln 413 of yolo_base.py (version 3.2.0) and training starts.

@BloodAxe BloodAxe added the Planned The fix is on the roadmap label Aug 31, 2023
@BloodAxe
Copy link
Collaborator

BloodAxe commented Sep 5, 2023

Fixed in 3.2.1 release.

@BloodAxe BloodAxe closed this as completed Sep 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Something isn't working Planned The fix is on the roadmap
Projects
None yet
Development

No branches or pull requests

3 participants