import torchvision报错,UserWarning: Failed to load image Python extension: Could not find module ‘C:\U

导入torchvision时报错:

UserWarning: Failed to load image Python extension: Could not find module 'C:\Users\user\Anaconda3\envs\py38env\Lib\site-packages\torchvision\image.pyd' (or one of its dependencies). Try using the full path with constructor syntax. warn(f"Failed to load image Python extension: {e}")
解决方法:
卸载torchvision后重新安装,成功解决。

pip uninstall torchvision
pip install torchvision

你可能感兴趣的:(python,开发语言,pytorch)