目的:使用混合精度训练模型
方法:最新版pytorch1.6已封装进混合量化的模块,只需几句代码就可以提高batch size,速度会有非常大的提升。
安装pytorch:

pip install torch-1.6.0+cu101-cp37-cp37m-win_amd64.whl

报错:

DEPRECATION: Python 3.5 reached the end of its life on September 13th, 2020. Please upgrade your Python as Python 3.5 is no longer maintained. pip 21.0 will drop support for Python 3.5 in January 2021. pip 21.0 will remove support for this functionality.
WARNING: Requirement 'torch-1.6.0+cu101-cp37-cp37m-win_amd64.whl' looks like a filename, but the file does not exist
ERROR: torch-1.6.0+cu101-cp37-cp37m-win_amd64.whl is not a supported wheel on this platform.

查了一下,应该是python版本的问题,
最新的pytorch1.6版本需要安装python3.7,我的python是3.5,遂安装3.7,linux安装3.7参考https://www.cnblogs.com/guo2733/p/11459144.html
结果报错:

ModuleNotFoundError: No module named '_ctypes'
Makefile:1122: recipe for target 'install' failed
make: *** [install] Error 1

解决方法:参考https://blog.csdn.net/wang725/article/details/79905612
一般都是让更新,安装libffi-dev,但更新还有评论里的方法试了都不行,运行更新报错:

root@98ac4a9e8de7:/usr/local/python3# apt-get update
Get:1 file:/var/nvinfer-runtime-trt-repo-4.0.1-ga-cuda9.0  InRelease
Ign:1 file:/var/nvinfer-runtime-trt-repo-4.0.1-ga-cuda9.0  InRelease
Get:2 file:/var/nvinfer-runtime-trt-repo-4.0.1-ga-cuda9.0  Release [574 B]
Get:2 file:/var/nvinfer-runtime-trt-repo-4.0.1-ga-cuda9.0  Release [574 B]
Hit:4 http://archive.ubuntu.com/ubuntu xenial InRelease
Get:5 http://archive.ubuntu.com/ubuntu xenial-updates InRelease [109 kB]
Get:6 http://archive.ubuntu.com/ubuntu xenial-backports InRelease [107 kB]
Ign:7 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64  InRelease
Get:8 http://security.ubuntu.com/ubuntu xenial-security InRelease [109 kB]
Ign:9 https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1604/x86_64  InRelease
Get:10 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64  Release [169 B]
Hit:11 https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1604/x86_64  Release
Get:13 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64  Release.gpg [169 B]
Ign:14 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64  Packages
Get:14 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64  Packages [327 kB]
Ign:14 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64  Packages
Get:14 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64  Packages [1382 kB]
Err:14 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64  PackagesWriting more data than expected (1383659 > 1382106)
Fetched 327 kB in 25s (12.9 kB/s)
Reading package lists... Done
E: Failed to fetch https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/Packages  Writing more data than expected (1383659 > 1382106)
E: Some index files failed to download. They have been ignored, or old ones used instead.

换源操作后,更新这边还是有问题,但重新编译了一遍python,安装上了…
不过pip3报错:

root@98ac4a9e8de7:/home/work/gaotong/datasets# python3 -V
Python 3.7.1
root@98ac4a9e8de7:/home/work/gaotong/datasets# pip3 -V
Traceback (most recent call last):File "/usr/local/bin/pip3", line 5, in <module>from pip._internal.cli.main import main
ModuleNotFoundError: No module named 'pip._internal.cli'

发现下面这句可以成功运行,

pip3 install jieba -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
root@98ac4a9e8de7:/usr/local/python3/Python-3.7.1# pip3 install jieba -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
Looking in indexes: http://pypi.douban.com/simple/
Collecting jiebaDownloading http://pypi.doubanio.com/packages/c6/cb/18eeb235f833b726522d7ebed54f2278ce28ba9438e3135ab0278d9792a2/jieba-0.42.1.tar.gz (19.2MB)100% |████████████████████████████████| 19.2MB 1.9MB/s
Installing collected packages: jiebaRunning setup.py install for jieba ... done
Successfully installed jieba-0.42.1

所以先安装了torch1.5.

pip3 install torch==1.5.0 -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com

再安装完opencv-python后,导入cv2会报错,还是

root@98ac4a9e8de7:/home/work/gaotong/datasets/Living_Body/pytorch/anti-spoofing_depth# python3
Python 3.7.1 (default, Sep 28 2020, 07:00:01)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
Traceback (most recent call last):File "<stdin>", line 1, in <module>File "/usr/local/lib/python3.7/site-packages/cv2/__init__.py", line 5, in <module>from .cv2 import *
ImportError: libGL.so.1: cannot open shared object file: No such file or directory

参考博客:https://blog.csdn.net/qq_35516745/article/details/103822597
问题完美解决。

ERROR: torch-1.6.0+cu101-cp37-cp37m-win_amd64.whl is not a supported wheel on this platform.相关推荐

  1. ERROR: torch-1.4.0+cpu-cp38-cp38m-win_amd64.whl is not a supported wheel on this platform.

    输入老师给的下载pytorch和torchvision的命令报错找不到版本 pip install torch==1.4.0 torchvision==0.5.0 -i https://pypi.do ...

  2. ERROR: torch-1.12.0+cu116-cp38-cp38-win_amd64.whl is not a supported wheel on this platform.

    ERROR: torch-1.12.0+cu116-cp38-cp38-win_amd64.whl is not a supported wheel on this platform. 安装Pytor ...

  3. ERROR: PyAudio-0.2.11-cp37-cp37m-win32.whl is not a supported wheel on this platform.问题解决方法

    ERROR: PyAudio-0.2.11-cp37-cp37m-win32.whl is not a supported wheel on this platform. 安装 PyAudio时出现的 ...

  4. ERROR: pyHook-1.5.1-cp37-cp37m-win_amd64.whl is not a supported wheel on this platform.安装pyhook报错

    ERROR: pyHook-1.5.1-cp37-cp37m-win_amd64.whl is not a supported wheel on this platform.安装pyhook报错 系统 ...

  5. Windows下python程序报错Nomodule named 'gevent'解决及ERROR: xxx.whl is not a supported wheel on this platform

    在windows下面直接简单安装gevent或其他库是不行的,必须使用源码包安装. 这里提供一个网址https://www.lfd.uci.edu/~gohlke/pythonlibs/ ,它是Win ...

  6. ERROR: mmcv_full-1.4.0-cp38-cp38-win_amd64.whl is not a supported wheel on this platform.

    原因是我的Annaconda的base环境的Python版本是3.9的所以无法安装cp38, 解决办法 新建一个虚拟环境,并将它的版本设置为3.8 去这个王者https://download.open ...

  7. python torchvision_pip install torchvision error:安装版本为0.4.1的torch后继续安装torchvision报错...

    pip install torchvision error:Could not find a version that satisfies the requirement torch==1.4.0 ( ...

  8. ERROR: No matching distribution found for torch==1.2.0 解决方法

    一.环境 系统环境:Windows10 Python版本:Python3.6.0 IDE:Pycharm.Spyder 二.问题 今天用 pip 安装torch,安装方式如下: pip install ...

  9. 【FFmpeg】警告:[mpegts] H.264 bitstream error, startcode missing, size 0

    1.问题描述 在使用FFmpeg编程,编码成h.264后,再封装成hls时,报警告 [mpegts] H.264 bitstream error, startcode missing, size 0 ...

最新文章

  1. PowerDesigner使用教程【转】
  2. python2.7练习小例子(二)
  3. 复合火焰探测传感器_火灾探测器分类
  4. java父类shape_java父类为抽象类,子类构造方法传参
  5. 不常见但是有用的 Chrome 调试技巧
  6. 互联网日报 | 1月18日 星期一 | 北京超10万滴滴司机预约接种疫苗;李子柒入驻饿了么;蔚来计划2021年在海外实现销售...
  7. 【Java】MANIFEST.MF是什么
  8. MIME媒体类型:简介,作用(描述并标记多媒体内容),示例
  9. python交互式帮助的进入、使用和退出_python退出交互式???
  10. 如何查看cudnn当前版本_当前版本的花木兰,如何成为边路战神?
  11. java项目-第33期基于SSM框架的图书管理系统【毕业设计】
  12. FEMTransfer软件实现Patran/Nastran/Abaqus/Ansys/Sesam(Genie)/Workbench/Femap/盈建科/PKPM仿真分析软件的有限元模型相互转换导入
  13. 阳历和农历互相转换的js代码
  14. 迁移学习系列--方法篇
  15. java http 401_java HttpClient模拟登陆一直401
  16. Java开发手册之二方库依赖
  17. icns文件怎么打开_Mac快速生成icns图标文件 | kTWO-个人博客
  18. 经典排序算法学习笔记二——快速排序
  19. 电脑输入法哪个最好用,提高工作效率就选它
  20. solidworks画螺纹

热门文章

  1. 内存分配者-动态内存
  2. 阿里巴巴年终JAVA岗发布+最新面试手册(P5-P7)
  3. Hive自定义函数(字母大小写转换)
  4. c语言任何一个大于6的偶数均可表示为两个素数之和,C语言:验证哥德巴赫猜想:任何一个大于6的偶数均可表示为2个素数之和...
  5. 写个神经网络,让她认得我`(๑•ᴗ•๑)(Tensorflow,opencv,dlib,cnn,人脸识别)
  6. 情感驿站 | 分享一些喜欢的句子
  7. 无频闪护眼灯哪个好?盘点四款无频闪的护眼台灯
  8. [2020首届祥云杯]带音乐家
  9. 读书笔记之——《谷歌和亚马逊如何做产品》
  10. Altium Designer 相同模块的布局布线操作