Skip to content

DenseNet Error #305

Answered by jacobgil
Pen721 asked this question in Q&A
Aug 1, 2022 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

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:

  • Is img a tensor ?
  • Did you already take care of image-net normalization ?

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Pen721
Comment options

Answer selected by Pen721
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants