Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to pickle weakref objects. #25

Open
oo92 opened this issue Oct 11, 2021 · 1 comment
Open

Not able to pickle weakref objects. #25

oo92 opened this issue Oct 11, 2021 · 1 comment

Comments

@oo92
Copy link

oo92 commented Oct 11, 2021

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
@mcbuehler
Copy link

#13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants