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 wrong #81

Open
SUPERadonai opened this issue Nov 9, 2024 · 1 comment
Open

model file wrong #81

SUPERadonai opened this issue Nov 9, 2024 · 1 comment

Comments

@SUPERadonai
Copy link

hi, i'm try to run the notebook, but i meet some problems.
it look's like the download model file is not correct, because it's too small:
image
and then when i run the code of "torch.load", it unsurprisingly threw an error:

UnpicklingError Traceback (most recent call last)
in <cell line: 8>()
6 vtoonify = VToonify(backbone = 'dualstylegan')
7 #vtoonify.load_state_dict(torch.load(os.path.join(MODEL_DIR, style_type+'_generator.pt'), map_location=lambda storage, loc: storage)['g_ema'])
----> 8 vtoonify.load_state_dict(torch.load(os.path.join(MODEL_DIR, 'cartoon026_generator.pt'), map_location=lambda storage, loc: storage)['g_ema'])
9 vtoonify.to(device)
10

1 frames
/usr/local/lib/python3.10/dist-packages/torch/serialization.py in _legacy_load(f, map_location, pickle_module, **pickle_load_args)
1626 )
1627
-> 1628 magic_number = pickle_module.load(f, **pickle_load_args)
1629 if magic_number != MAGIC_NUMBER:
1630 raise RuntimeError("Invalid magic number; corrupt file?")

UnpicklingError: invalid load key, '<'.

How could i fix this error? could you help me please.

@williamyang1991
Copy link
Owner

In this case, the comand fails to download the whol model (maybe due to your network settings or the Google Drive problem)
You can manually download the model from the URL shown in your screenshot to your local dir.
or download from Google Drive, Baidu Cloud (access code: sigg) or Hugging Face

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