junyanz / CycleGAN

Software that can generate photos from paintings, turn horses into zebras, perform style transfer, and more.
Other
12.23k stars 1.93k forks source link

Still using CUDA tensor when set to use CPU #73

Closed DeepS1X closed 6 years ago

DeepS1X commented 6 years ago
use InstanceNormalization   
loading previously trained model (/home/dev/CycleGAN/checkpoints/style_cezanne_pretrained/latest_net_G.t7)  
use InstanceNormalization   
/home/dev/torch/install/bin/luajit: /home/dev/torch/install/share/lua/5.1/torch/File.lua:343: unknown Torch class <torch.CudaTensor>
stack traceback:
    [C]: in function 'error'
    /home/dev/torch/install/share/lua/5.1/torch/File.lua:343: in function 'readObject'
    /home/dev/torch/install/share/lua/5.1/torch/File.lua:369: in function 'readObject'
    /home/dev/torch/install/share/lua/5.1/nn/Module.lua:192: in function 'read'
    /home/dev/torch/install/share/lua/5.1/torch/File.lua:351: in function 'readObject'
    /home/dev/torch/install/share/lua/5.1/torch/File.lua:409: in function 'load'
    /home/dev/CycleGAN/util/util.lua:192: in function 'load_test_model'
    ./models/one_direction_test_model.lua:24: in function 'Initialize'
    test.lua:72: in main chunk
    [C]: in function 'dofile'
    ...dev/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:150: in main chunk
    [C]: at 0x5620d7133460

Not entirely sure why it's trying to use a CUDA tensor when it should be using a Float tensor (because my machine has a CPU), and I set cudnn and gpu to 0. For some reason, that causes an error when I'm trying to run the pretrained model (style_cezanne_pretrained) on ae_photos.

DeepS1X commented 6 years ago

This was the command I ran. DATA_ROOT=./datasets/ae_photos name=style_cezanne_pretrained model=one_direction_test phase=test loadSize=256 fineSize=256 resize_or_crop="scale_width" th test.lua

DeepS1X commented 6 years ago

Closed- I should have downloaded style_cezanne_cpu.