stylegan2
stylegan2 copied to clipboard
IndexError: list index out of range
Hi there,
first of all, thanks a lot for providing all of this information and code.
I have cloned your repo to a paperspace machine, but when running the training command
python run_training.py --num-gpus=1 --data-dir=./datasets --config=config-f --dataset=mydataset --mirror-augment=true
I get the following error:
Couldn't find valid snapshot, starting over Local submit - run_dir: results/00001-stylegan2-kris-1gpu-config-f dnnlib: Running training.training_loop.training_loop() on localhost... Streaming data using training.dataset.TFRecordDataset... Dataset shape = [3, 1024, 1024] Dynamic range = [0, 255] Label size = 0 Traceback (most recent call last): File "run_training.py", line 201, in <module> main() File "run_training.py", line 196, in main run(**vars(args)) File "run_training.py", line 127, in run dnnlib.submit_run(**kwargs) File "/home/paperspace/stylegan2/dnnlib/submission/submit.py", line 343, in submit_run return farm.submit(submit_config, host_run_dir) File "/home/paperspace/stylegan2/dnnlib/submission/internal/local.py", line 22, in submit return run_wrapper(submit_config) File "/home/paperspace/stylegan2/dnnlib/submission/submit.py", line 280, in run_wrapper run_func_obj(**submit_config.run_func_kwargs) File "/home/paperspace/stylegan2/training/training_loop.py", line 149, in training_loop resume_pkl, resume_kimg = misc.locate_latest_pkl(dnnlib.submit_config.run_dir_root) File "/home/paperspace/stylegan2/training/misc.py", line 55, in locate_latest_pkl latest_pickle = allpickles[-1] IndexError: list index out of range
Any idea how to fix this?
For others who encounter the same error:
I managed to solve this issue by adding the missing pkl file to the repo (same steps as in the second code cell of this notebook: https://colab.research.google.com/drive/1WUjbK-9UhRU5xPWf48MeKXbHqoPV8LNP
First, I added a folder called 00001-pretrained
in the results folder
with
mkdir 00001-pretrained
Then I downloaded the ffhq checkpoint into the folder with
gdown --id 1UlDmJVLLnBD9SnLSMXeiZRO6g-OMQCA_
After that I renamed the file with
mv stylegan2-ffhq-config-f.pkl network-snapshot-10000.pkl
That did the trick. 😃