Hey guys, I keep encountering this error in my code even though I have I have entered the right input_channel number and output.
Can’t see the error mentioned, but for the present one in notebook:
Torch models working with images expect the input to be a batch of images.
You need to convert your image (3-dimensional tensor) into a batch (4-dimensional tensor).
You can do so with
thank you for your reply, I have found the issue, there was a problem in the architecture of the model, but it seems that there is another problem I can’t find the cause.
Subset class is returned.
To access the dataset from
Subset you can use
dataset although is a whole dataset (the one you used before splitting), so it has all examples.
But since you care here only for a class name for given label, it should work without problems.
so how should I access
for this you have to split your datasets using random_split.
yes, but I can’t make predictions on single images.
can you share me your code, i will check it.