pi-GAN icon indicating copy to clipboard operation
pi-GAN copied to clipboard

Not able to pickle weakref objects.

Open oo92 opened this issue 3 years ago • 1 comments

Hi.

I'm using the celeb_a dataset from Kaggle because I want to test the pi-GAN and try it with a custom dataset should I get it working. After changing the curriculum's dataset_path, I ran this command:

CUDA_VISIBLE_DEVICES=0 python3 pi-GAN/train.py --curriculum CelebA --output_dir celebAOutputDir

Unfortunately, I got hit with this error:

Namespace(curriculum='CelebA', eval_freq=5000, load_dir='', model_save_interval=5000, n_epochs=3000, output_dir='celebAOutputDir', port='12355', sample_interval=200, set_step=None)
Total progress:   0% 0/3000 [00:00<?, ?it/s]
0it [00:00, ?it/s]/usr/local/lib/python3.7/dist-packages/torchvision/transforms/transforms.py:281: UserWarning: Argument interpolation should be of type InterpolationMode instead of int. Please, use InterpolationMode enum.
  "Argument interpolation should be of type InterpolationMode instead of int. "

  0% 0/200000 [00:00<?, ?it/s]
Total progress:   0% 1/3000 [00:07<5:56:04,  7.12s/it]
Progress to next stage:   0% 0/200000 [00:06<?, ?it/s]
Traceback (most recent call last):
  File "pi-GAN/train.py", line 400, in <module>
    mp.spawn(train, args=(num_gpus, opt), nprocs=num_gpus, join=True)
  File "/usr/local/lib/python3.7/dist-packages/torch/multiprocessing/spawn.py", line 230, in spawn
    return start_processes(fn, args, nprocs, join, daemon, start_method='spawn')
  File "/usr/local/lib/python3.7/dist-packages/torch/multiprocessing/spawn.py", line 188, in start_processes
    while not context.join():
  File "/usr/local/lib/python3.7/dist-packages/torch/multiprocessing/spawn.py", line 150, in join
    raise ProcessRaisedException(msg, error_index, failed_process.pid)
torch.multiprocessing.spawn.ProcessRaisedException: 

-- Process 0 terminated with the following error:
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/torch/multiprocessing/spawn.py", line 59, in _wrap
    fn(i, *args)
  File "/content/pi-GAN/train.py", line 181, in train
    torch.save(ema, os.path.join(opt.output_dir, now + 'ema.pth'))
  File "/usr/local/lib/python3.7/dist-packages/torch/serialization.py", line 379, in save
    _save(obj, opened_zipfile, pickle_module, pickle_protocol)
  File "/usr/local/lib/python3.7/dist-packages/torch/serialization.py", line 484, in _save
    pickler.dump(obj)
TypeError: can't pickle weakref objects

oo92 avatar Oct 11 '21 03:10 oo92

#13

mcbuehler avatar Oct 19 '21 16:10 mcbuehler