Could you print the shape of the input Variable?
What does dimension 1 stand for in inp?
The dimensions of image data are defined as [batch, channels, width, height].
It seems you have an additional dimension.