-
Hi! I'm working through the tutorial and trying to make a visualization for a 96x96x3 image using DenseNet but running into the following error, wondering if there's anyway I can fix this. Thanks so much!
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi, In your case the tensor has shape 96, 96, 3 But let me ask you to be sure:
|
Beta Was this translation helpful? Give feedback.
Hi,
The image that's sent to the model has to be a tensor, pre-processed (if any preprocessing is required, like for pretrained models on imagenet), and with shape batch x 3 x height x width
In your case the tensor has shape 96, 96, 3
You can make it 1 x 3 x 96 x 96 like this:
img = img.transpose(2, 0, 1).unsqueeze(0
But let me ask you to be sure: