“ValueError: too many values to unpack (expected 3)” when trying to run StyleGAN2 generating command

327 views Asked by At

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?

0

There are 0 answers