martinbenson / deep-photo-styletransfer

Implementation of "Deep Photo Style Transfer": https://arxiv.org/abs/1703.07511
MIT License
204 stars 27 forks source link

THCudaCheck FAIL file=/root/torch/extra/cutorch/init.c line=734 error=10 : invalid device ordinal #38

Closed kitylam9 closed 7 years ago

kitylam9 commented 7 years ago

Dear All, I just found this problem when I try all two examples on readme and got below error, may I know how to solve this, my computer is ubuntu 16.04, graphic card is GeForce GTX 970/PCIe/SSE2, I did not install cuda toolkit in ubuntu so dont know this cause problem or not, thank loading matting laplacian... examples/waterfront700.csv
Setting up style layer 2 : relu1_1 Setting up style layer 7 : relu2_1 Setting up style layer 12 : relu3_1 Setting up style layer 21 : relu4_1 Setting up content layer 23 : relu4_2 Setting up style layer 30 : relu5_1 THCudaCheck FAIL file=/root/torch/extra/cutorch/init.c line=734 error=10 : invalid device ordinal /root/torch/install/bin/luajit: /root/torch/install/share/lua/5.1/cutorch/init.lua:31: cuda runtime error (10) : invalid device ordinal at /root/torch/extra/cutorch/init.c:734 stack traceback: [C]: in function 'setDevice' /root/torch/install/share/lua/5.1/cutorch/init.lua:31: in function 'withDevice' /root/torch/install/share/lua/5.1/nn/GPU.lua:144: in function 'type' /root/torch/install/share/lua/5.1/nn/utils.lua:45: in function 'recursiveType' /root/torch/install/share/lua/5.1/nn/utils.lua:41: in function 'recursiveType' /root/torch/install/share/lua/5.1/nn/Module.lua:160: in function 'type' deepmatting_seg.lua:254: in function 'main' deepmatting_seg.lua:857: in main chunk [C]: in function 'dofile' /root/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:150: in main chunk [C]: at 0x00406670

martinbenson commented 7 years ago

The example assumes that you have 2 GPUs (as per the notes) and it sounds like you don't. If you drop the -gpu and -multigpu_strategy arguments it should work.

kitylam9 commented 7 years ago

It work now thank you so much gentleman~~~