autonomousvision / stylegan-xl

[SIGGRAPH'22] StyleGAN-XL: Scaling StyleGAN to Large Diverse Datasets
MIT License
961 stars 113 forks source link

ModuleNotFoundError: No module named '__builtin__' #71

Open nicholasjprimianomd opened 2 years ago

nicholasjprimianomd commented 2 years ago

On exiting training I receive the following error:

Exiting... Traceback (most recent call last): File "/home/nicholasjprimiano/stylegan_xl/train.py", line 336, in <module> main() # pylint: disable=no-value-for-parameter File "/home/nicholasjprimiano/miniconda3/envs/sgxl/lib/python3.9/site-packages/click/core.py", line 1134, in __call__ return self.main(*args, **kwargs) File "/home/nicholasjprimiano/miniconda3/envs/sgxl/lib/python3.9/site-packages/click/core.py", line 1059, in main rv = self.invoke(ctx) File "/home/nicholasjprimiano/miniconda3/envs/sgxl/lib/python3.9/site-packages/click/core.py", line 1401, in invoke return ctx.invoke(self.callback, **ctx.params) File "/home/nicholasjprimiano/miniconda3/envs/sgxl/lib/python3.9/site-packages/click/core.py", line 767, in invoke return __callback(*args, **kwargs) File "/home/nicholasjprimiano/stylegan_xl/train.py", line 328, in main cur_nimg = legacy.load_network_pkl(f)['progress']['cur_nimg'].item() File "/home/nicholasjprimiano/stylegan_xl/legacy.py", line 27, in load_network_pkl data = _LegacyUnpickler(f).load() File "/home/nicholasjprimiano/stylegan_xl/legacy.py", line 78, in find_class return super().find_class(module, name) ModuleNotFoundError: No module named '__builtin__' I am using the minconda3 env suggested in the readme. The find_class() is a method in the _Unpickler class. However I can't seem to track down where 'builtin' is required.

cile98 commented 1 year ago

@nicholasprimiano have you resolved this issue?

nicholasjprimianomd commented 1 year ago

Was a while ago do I do not think I solved this.

xyt000-xjj commented 1 year ago

image May I ask how to solve it

nicholasjprimianomd commented 1 year ago

I was not able to fix this issue.

arpit2412 commented 10 months ago

I had the same problem, now solved:

Make sure you have the pytorch and cuda as specified:

pip install torch==1.9.1+cu111 torchvision==0.10.1+cu111 torchaudio==0.9.1 -f https://download.pytorch.org/whl/torch_stable.html

Requirements file:

numpy>=1.20 click>=8.0 pillow==8.3.1 scipy==1.7.1 requests==2.26.0 tqdm==4.62.2 ninja==1.10.2 matplotlib==3.4.2 imageio==2.9.0 dill==0.3.4 psutil==5.8.0 regex==2022.3.15 imgui==1.3.0 glfw==2.2.0 pyopengl==3.1.5 imageio-ffmpeg==0.4.3 pyspng ftfy==6.1.1 timm==0.4.12 torchvision==0.10.1

Make sure if you are using pretrained or resume use --network, (not --path_stem)