HowieMa / CVTHead

[WACV 2024] "CVTHead: One-shot Controllable Head Avatar with Vertex-feature Transformer"
https://arxiv.org/pdf/2311.06443.pdf
96 stars 8 forks source link

Error: _pickle.UnpicklingError: invalid load key, '<'. #2

Closed VoHoangAnh closed 7 months ago

VoHoangAnh commented 7 months ago

Thank you for your great work! I set up the environment as requirements.txt, however, I met this error when the model file "data/cvthead.pt" was loaded in inference.py

magic_number = pickle_module.load(f, **pickle_load_args) _pickle.UnpicklingError: invalid load key, '<'

I am very thankful if you can suggest the solution to fix it.

VoHoangAnh commented 7 months ago

I solved it Thank you.

LeeTeng2001 commented 6 months ago

hey, what's the solution here???

VoHoangAnh commented 6 months ago

I saved the model file in another PyTorch version.

cvipym commented 6 months ago

Hi, could you please provide more detailed steps on how to save the model file in a different PyTorch version? I'm having trouble understanding the process and would appreciate your guidance.

VoHoangAnh commented 6 months ago

In my case, I used torch 1.11.0 instead of torch 2.0, as illustrated in requirement.txt. you can save the model file in torch 1.11.0 and then use torch 2.0 to load it. I don't know the reason but it worked

cvipym commented 6 months ago

Thank you, I appreciate your response. But, I don't understand saving the model using torch. Aren't files downloaded using bash scripts?

YacratesWyh commented 5 months ago

Google Drive using bash to download would cause viruse scan instead of direct download it, it's an update version. You have to download it manually. If you want a quick check, just check your model, whether they are very tiny like 3KB, then the .sh is failed like me. @HowieMa Hope you fix this

YacratesWyh commented 5 months ago

https://github.com/tensorflow/datasets/issues/3935 To solve this, add like this in bash

mengsiwei commented 4 days ago

Hi, could you please provide more detailed steps on how to save the model file in a different PyTorch version? I'm having trouble understanding the process and would appreciate your guidance.

Hello! Have you solved this problem now? I also encountered this problem.