在运行代码时会遇到得使用旧版本torch、torchvision的情况,很容易遇到下载很慢、断开的情况。这里提供两种解决方法。 1.换源 pip install 安装包名字 -i https://pypi.tuna.tsinghua.edu.cn/simple or pip install 安装包名字 -i http://pypi.doubanio.com/simple/ 2. 官网下载离线安装包后安装 下载离线安装包 下载到Ubuntu后pip install 文件即可