It’s hard to say without looking at your code, but check the type of whatever is being passed into resize to ensure that it’s a PIL image as expected (you mentioned that you are putting in a tensor and it expects a PIL image).  When weird issues come up in a jupyter notebook it might help to refresh the kernel to ensure that you are not using old variables as well.