Skip to content

error converting .pkl to .pt file #9

Description

@zjgt

Thanks for sharing Convert_pkl_to_pt.ipynb. I do not have a problem with the model provided when run in google colab, but encounter an issue when using my own custom model. My custom model is trained with 512x512 images with stylegan2-ada-pytorch with all default settings.

Traceback (most recent call last):
File "/content/stylegan2-pytorch/convert_weight.py", line 236, in
generator, discriminator, g_ema = pickle.load(f)
ModuleNotFoundError: No module named 'torch_utils'

After I pip install torch_utils, I got the following message:
Traceback (most recent call last):
File "/content/stylegan2-pytorch/closed_form_factorization.py", line 18, in
ckpt = torch.load(args.ckpt)
File "/usr/local/lib/python3.7/dist-packages/torch/serialization.py", line 608, in load
return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
File "/usr/local/lib/python3.7/dist-packages/torch/serialization.py", line 777, in _legacy_load
magic_number = pickle_module.load(f, **pickle_load_args)
ModuleNotFoundError: No module named 'torch_utils.persistence'

What should I do?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions