nupurkmr9/vision-aided-gan

error while converting .pkl to .pt

Closed this issue · 1 comments

showing vision_module not found while unpickeling the weights

Loading "../../Generator/vision-aided-gan/stylegan2/models/00047-align-mirror-stylegan2-kimg10000-ada-input-clip-output-conv_multi_level-cv_loss_multilevel_sigmoid_s-augcv_ada-resumecustom/network-snapshot-best.pkl"...
Traceback (most recent call last):
  File "legacy.py", line 382, in <module>
    convert_network_pickle() # pylint: disable=no-value-for-parameter
  File "/opt/conda/lib/python3.8/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/opt/conda/lib/python3.8/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/opt/conda/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/opt/conda/lib/python3.8/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "legacy.py", line 373, in convert_network_pickle
    data = load_network_pkl(f, force_fp16=force_fp16)
  File "legacy.py", line 23, in load_network_pkl
    data = _LegacyUnpickler(f).load()
  File "legacy.py", line 92, in find_class
    return super().find_class(module, name)
ModuleNotFoundError: No module named 'vision_module'

Hi,
Can you provide more details regarding which code you are using for conversion? Would be great if I can replicate the error.

If conversion of vision-aided discriminator is not required vision_module class can be ignored by passing an empty class for that in _LegacyUnpickler.