CycleGAN icon indicating copy to clipboard operation
CycleGAN copied to clipboard

Error applying pretrained models for CPU

Open dmartyanov opened this issue 6 years ago • 1 comments

Hi, I follow 'Apply a Pre-trained Model' steps in readme and run DATA_ROOT=./datasets/horse2zebra name=horse2zebra_cpu_pretrained gpu=0 cudnn=0 phase=test th test.lua then the error happens:

DataLoader UnalignedDataLoader was created.
Starting donkey with id: 1 seed: 4382
table: 0x41f41e98
table: 0x41dc13b0
running "find" on each class directory, and concatenate all those filenames into a single file containing all image paths for a given class
now combine all the files to a single large file
load the large concatenated list of sample paths to self.imagePath
cmd..wc -L '/tmp/lua_WHb7xf' |cut -f1 -d' '
120 samples found......................... 0/120 .......................................]  ETA: 0ms | Step: 0ms         
Updating classList and imageClass appropriately
 [======================================== 1/1 ========================================>]  Tot: 0ms | Step: 0ms         
Cleaning up temporary files
Dataset Size A:         120
Starting donkey with id: 1 seed: 6965
table: 0x40ee81c8
table: 0x412c2918
running "find" on each class directory, and concatenate all those filenames into a single file containing all image paths for a given class
now combine all the files to a single large file
load the large concatenated list of sample paths to self.imagePath
cmd..wc -L '/tmp/lua_TFytQO' |cut -f1 -d' '
140 samples found......................... 0/140 .......................................]  ETA: 0ms | Step: 0ms         
Updating classList and imageClass appropriately
 [======================================== 1/1 ========================================>]  Tot: 0ms | Step: 0ms         
Cleaning up temporary files
Dataset Size B:         140
use InstanceNormalization
model not found!    /home/dmartyanov/dist/CycleGAN/checkpoints/horse2zebra_cpu_pretrained/latest_net_G_A.t7
model not found!    /home/dmartyanov/dist/CycleGAN/checkpoints/horse2zebra_cpu_pretrained/latest_net_G_B.t7
processing batch 1
pathsA  {
  1 : "n02381460_4160.jpg"
}
pathsB  nil
/home/dmartyanov/dist/distro/install/bin/luajit: ./models/cycle_gan_model.lua:128: attempt to index field 'netG_A' (a nil value)
stack traceback:
        ./models/cycle_gan_model.lua:128: in function 'Forward'
        test.lua:100: in main chunk
        [C]: in function 'dofile'
        ...ist/distro/install/lib/luarocks/rocks/trepl/scm-1/bin/th:150: in main chunk
        [C]: at 0x00405d50

Kindly consider this problem and recommend the solution, I have no previous experience with Torch/Lua

dmartyanov avatar May 05 '18 17:05 dmartyanov

See this issue for potential solutions. Also if you are not familiar with Lua/Torch, you may want to use our PyTorch version written in python.

junyanz avatar May 23 '18 04:05 junyanz