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

_pickle.UnpicklingError: invalid load key, '\x0a'. #14

Open
oroscow opened this issue Sep 3, 2023 · 0 comments
Open

_pickle.UnpicklingError: invalid load key, '\x0a'. #14

oroscow opened this issue Sep 3, 2023 · 0 comments

Comments

@oroscow
Copy link

oroscow commented Sep 3, 2023

Hi, I've run Train.py successfully and the Test.py script works up until line 285, where I get the following:

Traceback (most recent call last): File "Test.py", line 362, in <module> test(test_dataframe) File "Test.py", line 285, in test model.load_state_dict(torch.load(Model_Path + model_name,map_location='cpu')) File "/home/oroscow/micromamba/envs/bioinfo/lib/python3.8/site-packages/torch/serialization.py", line 815, in load return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args) File "/home/oroscow/micromamba/envs/bioinfo/lib/python3.8/site-packages/torch/serialization.py", line 1033, in _legacy_load magic_number = pickle_module.load(f, **pickle_load_args) _pickle.UnpicklingError: invalid load key, '\x0a'.

I've read online that this has to do with either the protocol version or encoding style being used by PyTorch but I'm not familiar enough with the scripts or the package to know how to resolve this. Thanks for any and all help :)

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

1 participant