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

model file path issue. Getting error - ValueError: Model file is not found. Downloading or training. Please help! #211

Open
bbbts opened this issue Jun 23, 2024 · 1 comment

Comments

@bbbts
Copy link

bbbts commented Jun 23, 2024

after training. I saved my model file in a folder called 'MODEL FILE' (I edited it in the train.py file) and the training was done successfully. In how many places and/or files do I have to make changes so that I can run eval.py file correctly(so that it recognizes my 'MODEL FILE' folder correctly)?
Here is how the folder structure looks like -
image

Please help. Thanks!

@mahammadirfan
Copy link

I tackled this problem by first changing the default parameter --save-folder (second image below) to wherever my model is being downloaded (first image below). After that, I change the name of downloaded file to what this repo wants the filename to be.

image

image

For example, if you want to use fcn32s_vgg16_voc model, check the name of corresponding function name in the dictionary within file core/models/model_zoo.py. For fcn32s_vgg16_voc, the function name is get_fcn32s_vgg16_voc,.

Now this function doesn't do anything but calls another function get_fcn32s, that actually downloads the model using torch.load() and get_model_file() functions, the latter of which is PyTorch's internal function and latter can be found at core/models/model_store.py.

See line number 168, notice how I print the the model's name using the information given in the next line.
image

But even after loading the model, the state dictionary's parameters didn't match the pretrained downloaded file's parameters (shown below). I think it's only the difference in naming convention that's causing the issue.

image

@Tramac Let us know if you'll be going to update the codebase to accommodate updated pretrained files from PyTorch's official server.

Thanks

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