Reputation: 3057
I have a Torch Cuda Tensor of size 64x64x3x3 and I want to visualise its weights for a given layer as follows:
local layer = model:get(3)
local weights = layer.weight
local imgDisplay = image.toDisplayTensor{input=weights, padding=2, scaleeach=80}
This is producing an error:
'packed must be a HxW or KxHxW or Kx3xHxW tensor, or a list of tensors
How should I resize the tensor in order to use toDisplayTensor? Thanks.
Upvotes: 1
Views: 594
Reputation: 66805
Error seems to be very straight forward - you should provide data in the form of either:
In your case I assume that your image is 64x64 (or after current convolution is)? Then you need 3x3x64x64 Tensor, where first dimension is the one iterating over kernels, second - over colors, third and forth over the image itself.
Upvotes: 1