I am going through the ants bees transfer learning tutorial:
https://pytorch.org/tutorials/beginner/transfer_learning_tutorial.html
Instead of each epoch, I wanted to get results every x amount of batches, so I made a couple of tweaks (which probably doesn’t affect the problem I have):
if num % 100 == 0:
print(‘running_corrects’, running_corrects/( len(inputs) * num + 1)
running corrects should not be using auto-grad,
and I thought it would be printable.
When I print I get the tensor value:
“running_corrects tensor(0, device=‘cuda:0’)”
however if I try to .numpy
or .cpu
I get the error:
AttributeError: 'int' object has no attribute 'numpy'
AttributeError: ‘int’ object has no attribute ‘cpu’
I found this:
but don’t want to mess around with the version (unless I have to) as it took me a while to get Pytorch working (Windows 10).
Thank you.