Why I face the "UserWarning: The NumPy module was reloaded (imported a second time)..." when I run pytorch code?

Viewed 2170

My environment: Anaconda, Python 3.8.8, Pytorch1.8.1+cu111
Question: When I run the code below I get the following error:

UserWarning: "D:\Anaconda3\envs\pytorch\lib\site-packages\torch\cuda\amp\autocast_mode.py:5: UserWarning: The NumPy module was reloaded (imported a second time). This can in some cases result in small but subtle issues and is discouraged."

Code:

from PIL import Image
from torchvision import transforms

img_path = "data/train/ants_image/0013035.jpg"
img = Image.open(img_path)

tensor_trains = transforms.ToTensor()
tensor_img = tensor_trains(img)

print(tensor_img)

But the code work. Why does the above error message appear?

0 Answers
Related