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

Pretrained yolov3-spp-ultralytics.pt is not compatible with cfg/yolov3-asff.cfg #1097

Closed
anhnktp opened this issue Apr 25, 2020 · 26 comments
Closed
Labels
bug Something isn't working Stale Stale and schedule for closing soon

Comments

@anhnktp
Copy link

anhnktp commented Apr 25, 2020

KeyError: "weights/yolov3-spp-ultralytics.pt is not compatible with cfg/yolov3-asff.cfg. Specify --weights '' or specify a --cfg compatible with weights/yolov3-spp-ultralytics.pt. See #657"

Could you provide yolov3-asff pretrained ?
thank you!

@anhnktp anhnktp added the bug Something isn't working label Apr 25, 2020
@github-actions
Copy link

github-actions bot commented Apr 25, 2020

Hello @anhnktp, thank you for your interest in our work! Please visit our Custom Training Tutorial to get started, and see our Google Colab Notebook, Docker Image, and GCP Quickstart Guide for example environments.

If this is a bug report, please provide screenshots and minimum viable code to reproduce your issue, otherwise we can not help you.

@anhnktp anhnktp changed the title Can't parse yolov3-asff.cfg Pretrained yolov3-spp-ultralytics.pt is not compatible with cfg/yolov3-asff.cfg Apr 25, 2020
@glenn-jocher
Copy link
Member

@anhnktp your code is out of date. git pull or reclone.

@anhnktp
Copy link
Author

anhnktp commented Apr 26, 2020

@glenn-jocher tks. I will have a try !

@anhnktp
Copy link
Author

anhnktp commented Apr 26, 2020

@glenn-jocher Thanks for quick reply. I have a question, in yolov3-asff.cfg, I see with 80 class -> 258 filter. May be formular (6 + num_class) * 3 = filter ?

@glenn-jocher
Copy link
Member

@anhnktp yes, this is 85 * 3 plus 3 output channels for the asff operations.

Honestly though we could not get performance improvements with ASFF, I would recommend training with yolov3-spp with all default settings if you are training a custom dataset. If you are doing research, then go ahead and experiment!

@anhnktp
Copy link
Author

anhnktp commented Apr 26, 2020

@glenn-jocher After pull latest code, the bug still remain. I only change num_class in yolov3-asff.cfg from 80 -> 2 & filter from 258 -> 24. It seems pretrained model doesn't compatible with asff config. Do you know why ?
image

@glenn-jocher
Copy link
Member

@anhnktp asff is a special cfg, it needs 3 extra output channels at each output layer, so you'd need 27 channels in each place you have 24 now.

@glenn-jocher
Copy link
Member

glenn-jocher commented Apr 26, 2020

@anhnktp ah nevermind, it seems you already did this. Then as the error message says, your pretrained weights are not compatible with the cfg. You need to train from scratch:

python train.py --weights ''

@ChrisLiiiii
Copy link

@glenn-jocher I train my custom dataset which has 4 classes, and I set the classes=4 in [yolo] and change all the filters=258 to filters=30 in the yolov3-asff.cfg as you said. I train it:
python train.py --weights '' --cfg 'cfg/yolov3-asff.cfg' --cache-images
But I got this:
image

Do you know where I am wrong?

@glenn-jocher
Copy link
Member

@ChrisLiiiii yes you are correct, they are not compatible. If you want to use this cfg you should train from scratch python train.py --weights ''

@glenn-jocher
Copy link
Member

glenn-jocher commented May 13, 2020

@ChrisLiiiii ah, I see the problem. asff needs 3 extra filters per output layer, which is why there are 258 and not 255. So add 3 filters: filters=33.

@ChrisLiiiii
Copy link

ChrisLiiiii commented May 14, 2020

@glenn-jocher I have tried your suggestion to change 30 to 33, but I still get this similar results:
image

In my opinion, the dataset has 4 classes so the filters need to be changed to (4+5)*3+3=30 instead of 33, is that right?
And another thing I'm not sure about is whether I should change all the filters=258 to filters=30? Other than that, I only change the [yolo] classes to 4.
I'm sorry I bothered you when you were so busy, I really appreciate your help!

@glenn-jocher
Copy link
Member

@ChrisLiiiii ah, yes if the default would have been 27 filters with yolov3-spp then yes you should simply add 3 to that value. If its not working then it may be an error somewhere else in the cfg. I'd start with yolov3-spp.cfg anyway, we could not gete asff to show improvement in our own tests.

@github-actions
Copy link

This issue is stale because it has been open 30 days with no activity. Remove Stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the Stale Stale and schedule for closing soon label Jun 14, 2020
@ZZY-666
Copy link

ZZY-666 commented Aug 30, 2020

@ChrisLiiiii ah, yes if the default would have been 27 filters with yolov3-spp then yes you should simply add 3 to that value. If its not working then it may be an error somewhere else in the cfg. I'd start with yolov3-spp.cfg anyway, we could not gete asff to show improvement in our own tests.

I have the same problem as the friend above. When I + 3, I reported the same error. Please tell me how to solve it. Thank you.

@ChrisLiiiii
Copy link

@ChrisLiiiii ah, yes if the default would have been 27 filters with yolov3-spp then yes you should simply add 3 to that value. If its not working then it may be an error somewhere else in the cfg. I'd start with yolov3-spp.cfg anyway, we could not gete asff to show improvement in our own tests.

I have the same problem as the friend above. When I + 3, I reported the same error. Please tell me how to solve it. Thank you.

I had this problem because I didn't set ASFF = True in the models.py

ASFF = False # https://arxiv.org/abs/1911.09516

You can also check to see if there is a problem here

@ZZY-666
Copy link

ZZY-666 commented Aug 30, 2020

@ChrisLiiiii ah, yes if the default would have been 27 filters with yolov3-spp then yes you should simply add 3 to that value. If its not working then it may be an error somewhere else in the cfg. I'd start with yolov3-spp.cfg anyway, we could not gete asff to show improvement in our own tests.

I have the same problem as the friend above. When I + 3, I reported the same error. Please tell me how to solve it. Thank you.

I had this problem because I didn't set ASFF = True in the models.py

  yolov3/models.py


     Line 169
  in
  bf34ae0





    
      
       ASFF = False  # https://arxiv.org/abs/1911.09516 

You can also check to see if there is a problem here

Thank you very much for your suggestion. I can do the experiment now!Could you tell me your precision when you run yolov3-asff? Does it have a high precision?Thank you again!

@ChrisLiiiii
Copy link

@ChrisLiiiii ah, yes if the default would have been 27 filters with yolov3-spp then yes you should simply add 3 to that value. If its not working then it may be an error somewhere else in the cfg. I'd start with yolov3-spp.cfg anyway, we could not gete asff to show improvement in our own tests.
I have the same problem as the friend above. When I + 3, I reported the same error. Please tell me how to solve it. Thank you.
I had this problem because I didn't set ASFF = True in the models.py

  yolov3/models.py


     Line 169
  in
  bf34ae0





    
      
       ASFF = False  # https://arxiv.org/abs/1911.09516 

You can also check to see if there is a problem here

Thank you very much for your suggestion. I can do the experiment now!Could you tell me your precision when you run yolov3-asff? Does it have a high precision?Thank you again!

I did the experiment on my custom dataset.
To be honest, ASFF did not improve the accuracy of my experiment, probably because of the lack of pre-trained weights.

@ZZY-666
Copy link

ZZY-666 commented Aug 30, 2020

@ChrisLiiiii ah, yes if the default would have been 27 filters with yolov3-spp then yes you should simply add 3 to that value. If its not working then it may be an error somewhere else in the cfg. I'd start with yolov3-spp.cfg anyway, we could not gete asff to show improvement in our own tests.
I have the same problem as the friend above. When I + 3, I reported the same error. Please tell me how to solve it. Thank you.
I had this problem because I didn't set ASFF = True in the models.py
yolov3/models.py

 Line 169

in
bf34ae0

   ASFF = False  # https://arxiv.org/abs/1911.09516 

You can also check to see if there is a problem here

Thank you very much for your suggestion. I can do the experiment now!Could you tell me your precision when you run yolov3-asff? Does it have a high precision?Thank you again!

I did the experiment on my custom dataset.
To be honest, ASFF did not improve the accuracy of my experiment, probably because of the lack of pre-trained weights.

If there is no pre training weight, the results of more training rounds should be the same. Thank you for your answer. I will communicate with you after the experiment. Before + 3, the accuracy is about 0.06, and I hope to have a good experimental result after the change.

@ChrisLiiiii
Copy link

@ZZY-666 Do you mean the accuracy of your experiment is only 6%? That's quite bad. Maybe your targets are very difficult to be detected?

@ZZY-666
Copy link

ZZY-666 commented Aug 30, 2020

@ZZY-666 Do you mean the accuracy of your experiment is only 6%? That's quite bad. Maybe your targets are very difficult to be detected?

Haha,It is before the number of filters is increased by 3, the dataset can reach 97% in v3. After the change(+3) is in training now, hope to have a good result.

@ChrisLiiiii
Copy link

@ZZY-666 Do you mean the accuracy of your experiment is only 6%? That's quite bad. Maybe your targets are very difficult to be detected?

Haha,It is before the number of filters is increased by 3, the dataset can reach 97% in v3. After the change(+3) is in training now, hope to have a good result.

Come on. If your accuracy has improved, I hope I can do the same.

@ZZY-666
Copy link

ZZY-666 commented Aug 30, 2020

@ZZY-666 Do you mean the accuracy of your experiment is only 6%? That's quite bad. Maybe your targets are very difficult to be detected?

Haha,It is before the number of filters is increased by 3, the dataset can reach 97% in v3. After the change(+3) is in training now, hope to have a good result.

Come on. If your accuracy has improved, I hope I can do the same.

OK, I'll let you know when the results come out. Keep in touch. Thank you!

@ZZY-666
Copy link

ZZY-666 commented Sep 1, 2020

@ChrisLiiiii ah, yes if the default would have been 27 filters with yolov3-spp then yes you should simply add 3 to that value. If its not working then it may be an error somewhere else in the cfg. I'd start with yolov3-spp.cfg anyway, we could not gete asff to show improvement in our own tests.

I have the same problem as the friend above. When I + 3, I reported the same error. Please tell me how to solve it. Thank you.

I had this problem because I didn't set ASFF = True in the models.py

  yolov3/models.py


     Line 169
  in
  bf34ae0





    
      
       ASFF = False  # https://arxiv.org/abs/1911.09516 

You can also check to see if there is a problem here

兄弟我看你是武汉的 方便给个q吗 我yolov3-asff的训练结果还不错

@ZZY-666
Copy link

ZZY-666 commented Sep 5, 2020 via email

@JJQQJJQQ
Copy link

@ZZY-666 兄弟你好,请问你使用asff后模型是否有效果?Hello ,does the model work after you use AFSS module?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Stale Stale and schedule for closing soon
Projects
None yet
Development

No branches or pull requests

5 participants