Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Have problem when setup. #4

Closed
ray075hl opened this issue Dec 6, 2018 · 3 comments
Closed

Have problem when setup. #4

ray075hl opened this issue Dec 6, 2018 · 3 comments

Comments

@ray075hl
Copy link

ray075hl commented Dec 6, 2018

@fqnchina thanks for share the great paper and code.
Machine environment is ubuntu16.04; torch 7; cuda 8.
When I set up the environment to run this command
th test_smooth.lua
I got the error message:

torch/install/share/lua/5.2/nn/EdgeComputation.lua:17: attempt to call field' EdgeComputation_updateOutput' (a nil value)
stack traceback:
~/torch/install/share/lua/5.2/nn/EdgeComputation.lua:17: in function <~/torch/install/share/lua/5.2/nn/EdgeComputation.lua:9>
...

Edited file ~/torch/extra/nn/init.lua

require('nn.Jacobian')
require('nn.SparseJacobian')
require('nn.hessian')
require('nn.test')

require('nn.EdgeComputation')
require('nn.EdgeDetector')
require('nn.SmoothAndEdgeTerm')

return nn

Edited file ~/torch/extra/cunn/lib/THCUNN/generic/THCUNN.h

TH_API void THNN_(VolumetricUpSamplingTrilinear_updateGradInput)(
                  THCState *state,
                  THCTensor *gradOutput,
                  THCTensor *gradInput,
                  int nbatch,
                  int nchannels,
                  int inputDepth,
                  int inputHeight,
                  int inputWidth,
                  int outputDepth,
                  int outputHeight,
                  int outputWidth);

void THNN_CudaEdgeComputation_updateOutput(
		THCState *state, 
		THCudaTensor *input, 
		THCudaTensor *output);
void THNN_CudaEdgeComputation_updateGradInput(
		THCState *state, 
		THCudaTensor *input, 
		THCudaTensor *gradOutput, 
		THCudaTensor *gradInput);

void THNN_CudaEdgeDetector_updateOutput(
		THCState *state, 
		THCudaTensor *input_image, 
		THCudaTensor *input_edge, 
		THCudaTensor *label_preserve, 
		THCudaTensor *label_eliminate, 
		int isSmoothing);

void THNN_CudaSmoothAndEdgeTerm_updateOutput(
		THCState *state, 
		THCudaTensor *input_cnn, 
		THCudaTensor *input_edge, 
		THCudaTensor *target_yuv, 
		THCudaTensor *target_edge, 
		THCudaTensor *target_edge_mask, 
		THCudaTensor *smooth_mask_pre, 
		THCudaTensor *smooth_mask, 
		THCudaTensor *weight, 
		THCudaTensor *output, 
		float sigma_color, 
		float sigma_space, 
		int window_size, 
		float lp, 
		int isDetailEnhancement, 
		int isStylization, int w_L2);

void THNN_CudaSmoothAndEdgeTerm_updateGradInput(
		THCState *state, 
		THCudaTensor *input_cnn, 
		THCudaTensor *smooth_mask, 
		THCudaTensor *target_edge_mask, 
		THCudaTensor *weight, 
		THCudaTensor *gradInput, 
		float sigma_color, 
		int window_size, 
		float lp, 
		int w_L2);

If I add "TH_API" before "void" , then will receive another error.

/home/hl/torch/install/bin/lua: /home/hl/torch/install/share/lua/5.2/trepl/init.lua:389:   
/home/hl/torch/install/share/lua/5.2/trepl/init.lua:389:   
/home/hl/torch/install/share/lua/5.2/cunn/THCUNN.lua:77:   
unknown type TH_API on line 1428
stack traceback:
	[C]: in function 'error'

I can't find the solution for this, could you help me? Thanks a lot.

@ray075hl ray075hl closed this as completed Dec 6, 2018
@ray075hl ray075hl reopened this Dec 6, 2018
@ray075hl
Copy link
Author

ray075hl commented Dec 6, 2018

I write in this way , it seems work.

TH_API void  THNN_(SmoothAndEdgeTerm_updateGradInput)(
		THCState *state, 
		THCudaTensor *input_cnn, 
		THCudaTensor *smooth_mask, 
		THCudaTensor *target_edge_mask, 
		THCudaTensor *weight, 
		THCudaTensor *gradInput, 
		float sigma_color, 
		int window_size, 
		float lp, 
		int w_L2);

@ray075hl ray075hl closed this as completed Dec 6, 2018
@shamimsareem
Copy link

Is there anyone who successfully run this code? I try to run it but failed due to environmental setup.
shamin@shamin-System-Product-Name:/media/shamin/Others/Research/Point_cloud/ImageSmoothing-master$ lua train_detail-enhance.lua
lua: train_detail-enhance.lua:1: module 'nn' not found:
no field package.preload['nn']
no file './nn.lua'
no file '/usr/local/share/lua/5.1/nn.lua'
no file '/usr/local/share/lua/5.1/nn/init.lua'
no file '/usr/local/lib/lua/5.1/nn.lua'
no file '/usr/local/lib/lua/5.1/nn/init.lua'
no file '/usr/share/lua/5.1/nn.lua'
no file '/usr/share/lua/5.1/nn/init.lua'
no file './nn.so'
no file '/usr/local/lib/lua/5.1/nn.so'
no file '/usr/lib/x86_64-linux-gnu/lua/5.1/nn.so'
no file '/usr/lib/lua/5.1/nn.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
stack traceback:
[C]: in function 'require'
train_detail-enhance.lua:1: in main chunk
[C]: ?
shamin@shamin-System-Product-Name:/media/shamin/Others/Research/Point_cloud/ImageSmoothing-master$

@zzojin
Copy link

zzojin commented Mar 31, 2019

Is there anyone who successfully run this code? I try to run it but failed due to environmental setup.
shamin@shamin-System-Product-Name:/media/shamin/Others/Research/Point_cloud/ImageSmoothing-master$ lua train_detail-enhance.lua
lua: train_detail-enhance.lua:1: module 'nn' not found:
no field package.preload['nn']
no file './nn.lua'
no file '/usr/local/share/lua/5.1/nn.lua'
no file '/usr/local/share/lua/5.1/nn/init.lua'
no file '/usr/local/lib/lua/5.1/nn.lua'
no file '/usr/local/lib/lua/5.1/nn/init.lua'
no file '/usr/share/lua/5.1/nn.lua'
no file '/usr/share/lua/5.1/nn/init.lua'
no file './nn.so'
no file '/usr/local/lib/lua/5.1/nn.so'
no file '/usr/lib/x86_64-linux-gnu/lua/5.1/nn.so'
no file '/usr/lib/lua/5.1/nn.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
stack traceback:
[C]: in function 'require'
train_detail-enhance.lua:1: in main chunk
[C]: ?
shamin@shamin-System-Product-Name:/media/shamin/Others/Research/Point_cloud/ImageSmoothing-master$

i have the same problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants