bytedance / Hammer

An efficient toolkit for training deep models.
Other
138 stars 15 forks source link

convert_model.py stylegan2 #1

Open Ruye-aa opened 1 year ago

Ruye-aa commented 1 year ago

Thanks your great work!

When i try to transform official weight .pkl to .pth, I found this error.

Dealing with  /home/resefa/Hammer-main/converters/stylegan2-ffhq-config-f.pkl ...

Traceback (most recent call last):
  File "convert_model.py", line 58, in <module>
    main()
  File "convert_model.py", line 54, in main
    learning_rate=args.learning_rate)
  File "/home/aiyang/resefa/Hammer-main/converters/base_converter.py", line 214, in run
    self.load_source(src_path)
  File "/home/aiyang/resefa/Hammer-main/converters/stylegan2_converter.py", line 61, in load_source
    G, D, Gs = pickle.load(f)
ModuleNotFoundError: No module named 'torch_utils.persistence'

I try to reinstall torch_utils and torch, but it didn't work. Need help!

TLi347 commented 1 year ago

You can try to download the torch_utils file from https://github.com/NVlabs/stylegan2-ada-pytorch and will solve this.