1

Got this error when trying to use Derrick Schultz's repository for StyleGAN2 neural training in Google Colab https://github.com/dvschultz/ai/blob/master/StyleGAN2_Colab_Train.ipynb

The command were:

!python run_generator.py generate-images --network=/content/drive/My\ Drive/stylegan2-colab-test/stylegan2/results/00002-stylegan2-birdaus-1gpu-config-f/submit_config.pkl --seeds=3875451-3876000 --truncation-psi=0.7

Everything prior were done as in the tutorial but with my own dataset. But then I got:

Local submit - run_dir: results/00006-generate-images
dnnlib: Running run_generator.generate_images() on localhost...
Loading networks from "/content/drive/My Drive/stylegan2-colab-test/stylegan2/results/00002-stylegan2-birdaus-1gpu-config-f/submit_config.pkl"...
Traceback (most recent call last):
  File "run_generator.py", line 490, in <module>
    main()
  File "run_generator.py", line 485, in main
    dnnlib.submit_run(sc, func_name_map[subcmd], **kwargs)
  File "/content/drive/My Drive/stylegan2-colab-test/stylegan2/dnnlib/submission/submit.py", line 343, in submit_run
    return farm.submit(submit_config, host_run_dir)
  File "/content/drive/My Drive/stylegan2-colab-test/stylegan2/dnnlib/submission/internal/local.py", line 22, in submit
    return run_wrapper(submit_config)
  File "/content/drive/My Drive/stylegan2-colab-test/stylegan2/dnnlib/submission/submit.py", line 280, in run_wrapper
    run_func_obj(**submit_config.run_func_kwargs)
  File "/content/drive/My Drive/stylegan2-colab-test/stylegan2/run_generator.py", line 120, in generate_images
    _G, _D, Gs = pretrained_networks.load_networks(network_pkl)
  File "/content/drive/My Drive/stylegan2-colab-test/stylegan2/pretrained_networks.py", line 76, in load_networks
    G, D, Gs = pickle.load(stream, encoding='latin1')
ValueError: too many values to unpack (expected 3)

This code were supposed to work as is, but doesn't. Unfortunately I'm not a coder myself. What needs to be changed here?

Xie Baoshi
  • 11
  • 2
  • If you read the most recent statement, it is expecting 3 values returned from `pickle.load(...)` pickle is finding more than 3 values in the stream. – RufusVS Aug 02 '20 at 06:28
  • If you are trying to *run someone else's code* and it doesn't work as advertised out of box, that is not on-topic for Stack Overflow. Since the code is from Github, the first place to check is the documentation there, and then the issue tracker. – Karl Knechtel Aug 02 '20 at 06:53

0 Answers0