visinf / n3net

Neural Nearest Neighbors Networks (NIPS*2018)
Other
286 stars 45 forks source link

Failure of training with CPU mode #11

Open tqyunwuxin opened 5 years ago

tqyunwuxin commented 5 years ago

Evaluation mode Checkpoints from ../results_gaussian_denoising/pretrained_sigma70 Writing to ../results_gaussian_denoising/pretrained_sigma70/test04/_data.pkl Epoch 51 Testing on Set12 Traceback (most recent call last): File "main.py", line 281, in main() File "main.py", line 257, in main run(my_experiment) File "main.py", line 239, in run evaluate(experiment) File "main.py", line 160, in evaluate test_epoch(epoch, experiment) File "main.py", line 119, in test_epoch pred = net(inputs) File "/home/tuqiang/anaconda3/envs/pt_py36/lib/python3.6/site-packages/torch/nn/modules/module.py", line 489, in call result = self.forward(*input, kwargs) File "/media/tuqiang/16af747f-50d9-46bf-82c1-788861185451/workspace/denoise_new/deeplearning_denoise/n3net/src_denoising/models/n3net.py", line 231, in forward x = self.nlsi File "/home/tuqiang/anaconda3/envs/pt_py36/lib/python3.6/site-packages/torch/nn/modules/module.py", line 489, in call result = self.forward(*input, *kwargs) File "/media/tuqiang/16af747f-50d9-46bf-82c1-788861185451/workspace/denoise_new/deeplearning_denoise/n3net/src_denoising/models/n3net.py", line 184, in forward x = self.n3aggregation(xg,xe,ye,log_temp=log_temp) File "/home/tuqiang/anaconda3/envs/pt_py36/lib/python3.6/site-packages/torch/nn/modules/module.py", line 489, in call result = self.forward(input, kwargs) File "/media/tuqiang/16af747f-50d9-46bf-82c1-788861185451/workspace/denoise_new/deeplearning_denoise/n3net/src_denoising/models/non_local.py", line 274, in forward x_patch, padding = ops.im2patch(x, self.patchsize, self.stride, None, returnpadding=True) File "/media/tuqiang/16af747f-50d9-46bf-82c1-788861185451/workspace/denoise_new/deeplearning_denoise/n3net/src_denoising/ops.py", line 121, in im2patch x2col = pyinn.im2col(xpad, [patchsize]2, [stride]2, [0,0]) NameError: name 'pyinn' is not defined

tobiasploetz commented 5 years ago

Hi @tqyunwuxin,

currently we only support GPU computation for N3Aggregation2D since im2col currently has no CPU implementation. It's probably not that hard to use some numpy functions to implement im2col on CPU, though.

Bests, Tobias