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

Use models.py to inference failed! #519

Open
d5423197 opened this issue Apr 15, 2022 · 1 comment
Open

Use models.py to inference failed! #519

d5423197 opened this issue Apr 15, 2022 · 1 comment

Comments

@d5423197
Copy link

Hello Author:

Thanks for your contribution.

I have downloaded the pth file mentioned in README.md. I used it in models.py script but got below errors.
image

Any help will be appreciated!

@Shiny-ZhangXiXin
Copy link

I have solved this problem, it seems to be an overlooked spelling problem. The main cause of the problem is the mismatch between the loaded pre-training model and the constructed network model.
image
Careful debugging of the code. In line 474, there is a network layer called neck in the model, but the layer in the pre-trained loaded model is called neek, so the inconsistency between the two causes the error message in the figure.
So I replaced all self.neck with self.neek in the code: class Yolov4(nn.module): balabala (there should be three changes: line 422, line 425, line 446)
Hope this can solve your problem ~

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

2 participants