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, 'v' #2

Closed
muzihuole opened this issue Apr 13, 2022 · 1 comment
Closed

_pickle.UnpicklingError: invalid load key, 'v' #2

muzihuole opened this issue Apr 13, 2022 · 1 comment

Comments

@muzihuole
Copy link

When I run the code python trainSpeakerNet.py --eval --model TDy_ResNet34_half --log_input True --encoder_type AVG --trainfunc softmaxproto --save_path exps/test --eval_frames 400 --initial_model pretrained_model/pretrained_TDy_ResNet34_half.model, there is an error as follow:
Python Version: 3.8.12 (default, Oct 12 2021, 03:01:40) [MSC v.1916 64 bit (AMD64)] PyTorch Version: 1.10.0+cu113 Number of GPUs: 1 Save path: exps/test ############################# TDy_ResNet34_half loaded Temp = 31 K = 6 ############################# Embedding size is 512, encoder AVG. Initialised Softmax Loss Initialised AngleProto Initialised SoftmaxPrototypical Loss Initialised Adam optimizer Initialised step LR scheduler Traceback (most recent call last): File "trainSpeakerNet.py", line 285, in <module> main() File "trainSpeakerNet.py", line 281, in main main_worker(0, None, args) File "trainSpeakerNet.py", line 170, in main_worker trainer.loadParameters(args.initial_model) File "C:\Users\Administrator\Desktop\Lis\temporal_dynamic_cnn-main\SpeakerNet.py", line 270, in loadParameters loaded_state = torch.load(path, map_location="cuda:%d"%self.gpu)['model_state_dict'] File "C:\Users\Administrator\.conda\envs\pytorch\lib\site-packages\torch\serialization.py", line 608, in load return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args) File "C:\Users\Administrator\.conda\envs\pytorch\lib\site-packages\torch\serialization.py", line 777, in _legacy_load magic_number = pickle_module.load(f, **pickle_load_args) _pickle.UnpicklingError: invalid load key, 'v'.

@muzihuole
Copy link
Author

When I download the correct pretrained model and use it, the problem is solved. Thanks for your great job! I will close this issue.

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