Hello,
i have started to work with pytorch in order to use it in my AI classes project. I have been following ‘60 minutes blitz’ tutorial and everything went quite smooth. The only difference is that im using ImageFolder - not the CIFAR10 dataset. Training my model went great but i occured a problem trying to modify an existing code. Previously, i used a folder with given classes(‘glass’,‘metal’,‘paper’,‘plastic’). My predicting function though needs to take an image path as an argument(just because i need to predict 1 single jpg)
Can you please give me some tips on how do i convert the given code so it makes usage of img_path and returns the single guess?
I would like to add that i have tried to resolve it myself but during the process i have stumbled on such errors as
’ TypeError: only integer tensors of a single element can be converted to an index’,
’ IndexError: index 3 is out of bounds for dimension 0 with size 3’
I would really appreciate some help, thank you