I am working on the VGG16 classification. But when I tried to test the model. I meet this error.
I tried to change for i in range(batch_size): to for i in range(len(target.data)):. But I still get this error. Anybody help me?
I am working on the VGG16 classification. But when I tried to test the model. I meet this error.
I tried to change for i in range(batch_size): to for i in range(len(target.data)):. But I still get this error. Anybody help me?
Check which of the objects creates the indexing error, print its shape as well as the corresponding index, and make sure the index is inside the bounds. I don’t know how correct
and class_correct
are created and thus can only speculate.