dgschwend / netscope

Neural network visualizer and analyzer
http://dgschwend.github.io/netscope
164 stars 72 forks source link

NaN when input data is 5D blob #8

Closed John1231983 closed 7 years ago

John1231983 commented 7 years ago

Hello, Thanks for sharing the good tool However, I got the NaN output dimension when I use the input data shape is 5D (sample, channel, depth, height, width), instead of the normal 4D blob ( (sample, channel, height, width). Could you fix it to allow input is 5D blob? Thanks This is my prototxt

input: "data"
input_dim: 1
input_dim: 3
input_dim: 48
input_dim: 224
input_dim: 224

layer {
  name: "conv1"
  type: "Convolution"
  bottom: "data"
  top: "conv1"
  convolution_param {
    num_output: 16
    pad: 1
    kernel_size: 3
    kernel_size: 3
    kernel_size: 3
    stride: 1
    weight_filler {
      type: "gausian"
      std : 0.1
    }
    bias_filler {
      type: "constant"
    }
  }
}
dgschwend commented 7 years ago

Hi! Thanks for the feedback. Unfortunately, extending the script to 5D would be pretty laborous and I don't have the time to do it right now.

However, I suggest you could try yourself. Coffescript is not very complicated. The relevant changes would be mostly in https://github.com/dgschwend/netscope/blob/gh-pages/src/analyzer.coffee (function analyze), and one more in https://github.com/dgschwend/netscope/blob/gh-pages/src/renderer.coffee (function insertLink). You would need to add the 5th dimension manually and probably change the interpretation of the dimensions (right now, the input_dims are mapped as [batch, chIn, hIn, wIn] which is the typical Caffe order for 2D data).

You can find info on changing and compiling the source code here: https://github.com/dgschwend/netscope/issues/4