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

Question about loading the pretrained salsanext model #24

Closed
maneekwant opened this issue Sep 20, 2021 · 8 comments
Closed

Question about loading the pretrained salsanext model #24

maneekwant opened this issue Sep 20, 2021 · 8 comments

Comments

@maneekwant
Copy link

Hi!

Thanks so much for the codes! I've a question about loading the pretrained salsanext model. When I followed the steps outlined in the "How to use" section and tested on the toy example, I came across the issue when trying to run infer.py on the toy dataset (python3 infer.py -d ../../../../data -m ../../../../data/model_salsanext_residual_1 -l ../../../../data/predictions_salsanext_residual_1_new -s valid) and got this error:

RuntimeError: ../../../../data/model_salsanext_residual_1/SalsaNext_valid_best is a zip archive (did you mean to use torch.jit.load()?)

I tried to switch from torch.load() to torch.jit.load() in the user.py as it suggested but it leads to other errors. What did I do wrong, or did I miss something along the way? I set up the environment according to the instruction linked on the github (using Pytorch 1.1).

Thank you in advance for your help!

@Chen-Xieyuanli
Copy link
Member

Hey @maneekwant, thanks for using our code!

You need to unzip the pre-trained model before using it.

If there are still any problems, please feel free to let me know.

@maneekwant
Copy link
Author

Thanks for the quick reply! I tried unzipping the SalsaNext_valid_best and now the error is that it’s a folder instead of a file. Did I miss something else too? Thanks so much!

@Chen-Xieyuanli
Copy link
Member

Thanks for the quick reply! I tried unzipping the SalsaNext_valid_best and now the error is that it’s a folder instead of a file. Did I miss something else too? Thanks so much!

Sorry, I misunderstood your question. You need to only unzip model_salsanext_residual_1 but not SalsaNext_valid_best.

It seems your torch cannot load it and could be a version conflict. Mine is Version: 1.5.1+cu101. You may upgrade the pytorch and give it another try.

@maneekwant
Copy link
Author

That works thanks so much!

@Chen-Xieyuanli
Copy link
Member

Thank you for using our code! If you find the code and my answer helpful, I will appreciate it if you could star our repo :-)

@llxClover
Copy link

That works thanks so much!

@maneekwant ,I meet the same problem, "FileNotFoundError: [Errno 2] No such file or directory: '../../../../data/model_salsanext_residual_1/SalsaNext_valid_best'",,,,,,,
could you tell me how to solve?

@maneekwant
Copy link
Author

@llxClover
I upgraded the pytorch version to 1.5.1 and that solved the issue!

@llxClover
Copy link

llxClover commented Oct 22, 2021 via email

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