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

Real-time evaluation error #3

Closed
terbed opened this issue Jun 23, 2020 · 2 comments
Closed

Real-time evaluation error #3

terbed opened this issue Jun 23, 2020 · 2 comments

Comments

@terbed
Copy link

terbed commented Jun 23, 2020

Hi!

I couldn't run the evaluation, there is something wrong with loading the model:

python evaluate_images.py --images /media/sztaki/pi/video5 --model pretrained/model_segmentation_realtime_skin_30.pth --model-type BiSeNetV2 --save

INFO:root:loading BiSeNetV2 from pretrained/model_segmentation_realtime_skin_30.pth
Traceback (most recent call last):
File "evaluate_images.py", line 58, in
model = load_model(models[args.model_type], torch.load(args.model))
File "/home/terbe/anaconda3/envs/pytorch/lib/python3.6/site-packages/torch/serialization.py", line 426, in load
return _load(f, map_location, pickle_module, **pickle_load_args)
File "/home/terbe/anaconda3/envs/pytorch/lib/python3.6/site-packages/torch/serialization.py", line 603, in _load
magic_number = pickle_module.load(f, **pickle_load_args)
_pickle.UnpicklingError: invalid load key, 'v'.

Is there any idea what could be the problem?

@WillBrennan
Copy link
Owner

WillBrennan commented Jun 23, 2020

It looks like its a pytorch version issue. I'd try creating the environment specified in this project and seeing if it happens again. Can you tell me what version of pytorch your using?

python -c 'import torch; print(torch.__version__)'

It should be 1.5.0 if you're using the enviroment?

The models in this repo are stored with git-lfs, the other option is that you didn't grab the models correctly. Their sizes might be zero when you look at them in file explorer?

To pull git-lfs files run,

git lfs pull

Or just download them directly from github. When I run it on mine it loads correctly,

(semantic_segmentation) will@will-workstation2:~/code/semantic_segmentation$ python evaluate_images.py --images /media/sztaki/pi/video5 --model pretrained/model_segmentation_realtime_skin_30.pth --model-type BiSeNetV2 --save
INFO:root:loading BiSeNetV2 from pretrained/model_segmentation_realtime_skin_30.pth
INFO:root:creating model with categories: ['skin']
INFO:root:evaluating images from /media/sztaki/pi/video5
Traceback (most recent call last):
  File "evaluate_images.py", line 72, in <module>
    for image_file in find_files(image_dir, ['.png', '.jpg', '.jpeg']):
  File "evaluate_images.py", line 31, in find_files
    assert dir_path.exists()
AssertionError

@terbed terbed closed this as completed Jun 25, 2020
@terbed
Copy link
Author

terbed commented Jun 25, 2020

Yes, installing a new version of pytorch solved the issue! Thank you!

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