We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I have been trying to apply the logic of deconvolution to VGG model. But so far have no success. The following is the modified code:
local feature_map = state.network.modules[state.network_table[currentId].i].output[1][filterNum]:clone() print("size of feature map is:") print(feature_map:size()) state.network.modules[state.network_table[currentId].i].output[1]:fill(0) state.network.modules[state.network_table[currentId].i].output[1][filterNum]:copy(feature_map) --- Guided back-propogation of ReLU -- http://arxiv.org/pdf/1412.6806v3.pdf local currentGradOutput = state.network.modules[state.network_table[currentId].i].output local currentModule = state.network.modules[state.network_table[currentId].i] for i=state.network_table[currentId].i-1,1,-1 do print("previous model: "..state.network.modules[i].__typename) local previousModule = state.network.modules[i] if currentModule.__typename =="nn.ReLU" then currentGradOutput = currentModule:backward(previousModule.output, currentGradOutput) currentGradOutput = currentModule:forward(currentGradOutput) else currentGradOutput = currentModule:backward(previousModule.output, currentGradOutput) end currentModule.gradInput = currentGradOutput currentModule = previousModule end currentGradOutput = currentModule:backward(input_img, currentGradOutput) print(currentGradOutput:size()) local gra = image.toDisplayTensor{input=currentGradOutput[1], zoom = 8} -- local fea = image.toDisplayTensor{input=feature_map, -- zoom = 8} image.save('vgg_deconv.png', gra)
Error
bad argument #5 to 'v' (2D or 4D weight tensor expected, but got: [] at /torch/extra/nn/lib/THNN/generic/SpatialConvolutionMM.c:15)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I have been trying to apply the logic of deconvolution to VGG model. But so far have no success. The following is the modified code:
Error
The text was updated successfully, but these errors were encountered: