SeungjunNah / DeepDeblur_release

Deep Multi-scale CNN for Dynamic Scene Deblurring
679 stars 142 forks source link

nil value #42

Closed zhuyating closed 4 years ago

zhuyating commented 5 years ago

Hey,Thank you for your shared code.I have modified the opts.lua: cmd:option('-threads', 0, 'number of main threads') cmd:option('-nDonkeys', 0, 'number of donkeys to initialize (data loading threads)') And I got an error when make this command: th main.lua -nEpochs 451 -save scale3

the error is : epoch begins : 1
==> training!
==> doing epoch on training data:
==> online epoch # 1 [mini-batchSize = 1]
/home/username/torch/install/bin/lua: train.lua:259: attempt to call field 'log10' (a nil value) stack traceback: train.lua:259: in function 'cumulate_error' train.lua:283: in function 'f2' data.lua:117: in function 'addjob' train.lua:275: in function 'train' main.lua:89: in main chunk [C]: in function 'dofile' ...name/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:150: in main chunk [C]: in ?

the error mentioned above is located in train.lua:259: cPSNR = cPSNR - 10math.log10(mse), I rewrote it as cPSNR = cPSNR - 10math.log10(math.abs(mse)+0.01),but makes no difference. Could you help me for this problem?Thank you very much.

SeungjunNah commented 5 years ago

Hi @zhuyating, Did you install torch correctly? 'math' package should have no problem calling math.log10 Could you check if the following code runs smoothly? Otherwise, you will need to fix or reinstall torch.

require 'math'
val = 5
val2 = math.log10(val)
print('math.log10(' .. val .. ') = ' .. val2)
zhuyating commented 5 years ago

Thank you for your reply.I have installed torch corretly like you mentioned before: require 'cutorch' require 'nn' require 'cunn' require 'cudnn'

But still got this error when running your code above :

/home/username/torch/install/bin/lua: torch.lua:3: attempt to call field 'log10' (a nil value) stack traceback: torch.lua:3: in main chunk [C]: in function 'dofile' ...name/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:150: in main chunk [C]: in ?

Is there any problem with my cuda or cudnn?I use cuda-9.2 and cudnn7,is it compatible with torch?But I have tried this command below,and it runs smoothly: cd ~/torch/extra/cudnn git checkout R6 # replace with a specefic version you would like luarocks make

But still have the error with math.log10.Do you have another suggestion?Thank you so much.

zhuyating commented 5 years ago

By the way ,I installed torch with Lua 5.2 instead of LuaJIT.

zhuyating commented 5 years ago

I use ubuntu16.04.It is said that torch7 is not compatible with cuda9.2,is it wright?Should I use cuda8.x?

SeungjunNah commented 5 years ago

I never had problems with math.log10, I don't really know what the main problem could be. I always used luajit and it might be the problem, but I'm not sure.

Regarding cuda version, torch7 hasn't been maintained for a while and it doesn't support cuda 9.2 I believe cuda 9.0 is the latest one you can use by setting an environment variable. You may want to look at this issue I usually put cudnn files in the cuda installation directory so that $LD_LIBRARY_PATH finds it together with cuda.

export TORCH_NVCC_FLAGS="-D__CUDA_NO_HALF_OPERATORS__"
./install.sh

# after installation is complete
cd ~/torch/extra/cudnn
git checkout R6 # replace with the version you installed in $LD_LIBRARY_PATH
luarocks make
zhuyating commented 5 years ago

Thanks for your kind help.I will have a try.

SeungjunNah commented 4 years ago

PyTorch version now available here: https://github.com/SeungjunNah/DeepDeblur-PyTorch

zhuyating commented 4 years ago

Hi @zhuyating, Did you install torch correctly? 'math' package should have no problem calling math.log10 Could you check if the following code runs smoothly? Otherwise, you will need to fix or reinstall torch.

require 'math'
val = 5
val2 = math.log10(val)
print('math.log10(' .. val .. ') = ' .. val2)

Thank you very much! I will have a try.