I have my model ready trained on data with labels called ‘labels2’ that have 0 and 1. I want to predict the new data and for it to have labels 0, 1, and 2 if it doesn’t recognize it.
This is the code I have written so far.
the dataset in imgset_loader’s shape is (4, 1, 32, 32)
labels=[0,1]
for i, images in enumerate(imgset_loader):
images = images.to(device)
net = net.double()
outputs = net(images)
_, predicted = torch.max(outputs, 1)
print((i,labels[predicted]))
But I think that something is wrong with it because I keep getting 1 as labels for all of them and when reloading the data it would show something random.
would it also be possible to show the name of the image along with the predicted value?