sony/san

TypeError in loading pretrained pkl

Closed this issue · 2 comments

Hello, Sir/Madam,

Thank you so much for sharing the code of the great work SAN. I like it very much.
I am trying to use the pretrained models. But when I run the following code
python calc_metrics.py --metrics=fid50k_full --network=./stylesan-xl_cifar10.pkl
I met the following error:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Loading network from "./sony_pretrained_models/stylesan-xl_cifar10.pkl"...
Traceback (most recent call last):
File "calc_metrics.py", line 191, in
calc_metrics() # pylint: disable=no-value-for-parameter
File "/home/shi/anaconda3/envs/san2/lib/python3.8/site-packages/click/core.py", line 1134, in call
return self.main(*args, **kwargs)
File "/home/shi/anaconda3/envs/san2/lib/python3.8/site-packages/click/core.py", line 1059, in main
rv = self.invoke(ctx)
File "/home/shi/anaconda3/envs/san2/lib/python3.8/site-packages/click/core.py", line 1401, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/shi/anaconda3/envs/san2/lib/python3.8/site-packages/click/core.py", line 767, in invoke
return __callback(*args, **kwargs)
File "/home/shi/anaconda3/envs/san2/lib/python3.8/site-packages/click/decorators.py", line 26, in new_func
return f(get_current_context(), *args, **kwargs)
File "calc_metrics.py", line 145, in calc_metrics
network_dict = legacy.load_network_pkl(f)
File "/data/shi/generation_fundamental/san-main/styleiisan-xl/legacy.py", line 25, in load_network_pkl
data = _LegacyUnpickler(f).load()
File "/home/shi/anaconda3/envs/san2/lib/python3.8/site-packages/dill/_dill.py", line 612, in _create_code
return CodeType(args[0], 0, 0, *args[1:])
TypeError: code() takes at most 16 arguments (19 given)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
I have installed the exact environment as you proposed.
and I wonder from the error message, it seem the problem from 'dill' library, but I tried from version 0.3.3 to 0.3.8, But the error always exist. Can you help me with this error? Thank you in advance.

Hello. Thank you for having an interest in our work!

Some colleagues inside met similar issues when they used local environments, but we haven't met an issue with the Docker set up described in README so far. I understand you have your familiar tool (Anaconda), but is it possible to try using the Dockerfile we're providing? Thank you.

Thank you so much for the response, Shibuya-san. Seems I need to start the studying and usage of the Docker :).