ganimation_replicate
ganimation_replicate copied to clipboard
AttributeError: Can't pickle local object 'BaseDataset.img_transformer.<locals>.<lambda>'
E:\Users\Raytine\Anaconda3\python.exe F:/pytorchgan/ganimation_replicate-master/main.py --mode test --data_root datasets/celebA --batch_size 8 --max_dataset_size 150 --gpu_ids 0 --ckpt_dir ckpts/celebA/ganimation/190327_161852/ --load_epoch 30
------------------- [ test][190508_160507]Options --------------------
aus_nc: 17
aus_pkl: aus_openface.pkl
batch_size: 8 [default: 25]
beta1: 0.5
ckpt_dir: ckpts/celebA/ganimation/190327_161852/ [default: ./ckpts]
data_root: datasets/celebA [default: None]
epoch_count: 1
final_size: 128
gan_type: wgan-gp
gpu_ids: [0] [default: 0]
img_nc: 3
imgs_dir: imgs
init_gain: 0.02
init_type: normal
interpolate_len: 5
lambda_aus: 160.0
lambda_dis: 1.0
lambda_mask: 0
lambda_rec: 10.0
lambda_tv: 0
lambda_wgan_gp: 10.0
load_epoch: 30 [default: 0]
load_size: 148
log_file: logs.txt
lr: 0.0001
lr_decay_iters: 50
lr_policy: lambda
lucky_seed: 1557302708 [default: 0]
max_dataset_size: 150 [default: inf]
mode: test [default: train]
model: ganimation
n_threads: 6
name: 190508_160507
ndf: 64
ngf: 64
niter: 20
niter_decay: 10
no_aus_noise: False
no_flip: False
no_test_eval: False
norm: instance
opt_file: opt.txt
plot_losses_freq: 20000
print_losses_freq: 100
resize_or_crop: none
results: results\celebA_ganimation_30 [default: results]
sample_img_freq: 2000
save_epoch_freq: 2
save_test_gif: False
serial_batches: False
test_csv: test_ids.csv
train_csv: train_ids.csv
train_gen_iter: 5
use_dropout: False
visdom_display_id: 0 [default: 1]
visdom_env: main
visdom_port: 8097
--------------------- [ test][190508_160507]End ----------------------
initialize network with normal
[Info] Successfully load trained weights for net_gen.
Test with Model [GANimation]
Set model to Test state.
Set net_gen to EVAL.
Traceback (most recent call last):
File "F:/pytorchgan/ganimation_replicate-master/main.py", line 16, in
Process finished with exit code 1
Hi, @c1a1o1 , what is the version of your PyTorch? It looks like the error you posted is raised by the PyTorch framework, and the project is built and tested on PyTorch version 0.4.1.
I use PyTorch 0.4.1 and python3.5
My celebA images is here:
F:\pytorchgan\ganimation_replicate-master\datasets\celebA\imgs
My celebA images is here:
F:\pytorchgan\ganimation_replicate-master\datasets\celebA\imgs
That is exactly the same relative path as I used.
I look deeper into your error info, and I think it is caused by the python multiprocessing used by the PyTorch framework. Specifically, it is related to the compatibility problem. Multiprocessing in python sometimes does not work well on Windows.
So I strongly suggest you to run this project on a Ubuntu or other Linux system.
@c1a1o1 , similar case and discussion can be seen at https://discuss.pytorch.org/t/cant-pickle-local-object-dataloader-init-locals-lambda/31857
I met the same problem. Have you solved it?
me too.
It's the problem of threads, you can set n_threads=0 or run in ubuntu