liw*_*ang 5 python numpy pytorch
我的环境: Anaconda、Python 3.8.8、Pytorch1.8.1+cu111
\n问题:当我运行下面的代码时,出现以下错误:
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."\n
Run Code Online (Sandbox Code Playgroud)\n代码:
\nfrom PIL import Image\nfrom torchvision import transforms\n\nimg_path = "data/train/ants_image/0013035.jpg"\nimg = Image.open(img_path)\n\ntensor_trains = transforms.ToTensor()\ntensor_img = tensor_trains(img)\n\nprint(tensor_img)\n
Run Code Online (Sandbox Code Playgroud)\n但代码有效。为什么会出现上面的错误信息\xef\xbc\x9f
\n