目录
- 引言
- 一、tensorflow
- 0,pip下载速度太慢,加上pip源
- 1,ERROR: Cannot uninstall 'wrapt'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
- 2,ImportError: DLL load failed: A dynamic link library (DLL) initialization routine failed.Failed to load the native TensorFlow runtime.See https://www.tensorflow.org/install/errorsfor some common reasons and solutions. Include the entire stack traceabove this error message when asking for help
- 二、opencv问题
引言
以前遇到问题,解决后很少记录,导致时间久了,再次遇到问题后仍然会去搜索相同的问题,加上网络上相关问题解决方案过于繁杂,特在此记录。望对大家也有帮助!
一、tensorflow
0,pip下载速度太慢,加上pip源
eg:pip install -i http://pypi.douban.com/simple/ --trusted-host=pypi.douban.com/simple tensorflow-gpu==1.12.0
豆瓣源:http://pypi.douban.com/simple/
清华源:https://pypi.tuna.tsinghua.edu.cn/simple/
阿里源:http://mirrors.aliyun.com/pypi/simple/
中国科学技术大学:https://pypi.mirrors.ustc.edu.cn/simple/
网易:http://mirrors.163.com/pypi/simple/
1,ERROR: Cannot uninstall ‘wrapt’. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
方法1:输入 pip install -U --ignore-installed wrapt enum34 simplejson netaddr
参考:https://bugs.launchpad.net/rally/+bug/1764545
2,ImportError: DLL load failed: A dynamic link library (DLL) initialization routine failed.Failed to load the native TensorFlow runtime.See https://www.tensorflow.org/install/errorsfor some common reasons and solutions. Include the entire stack traceabove this error message when asking for help
使用pip下载成功tensorflow后,在当前环境中使用python进行验证tensorflow是否安装成功。import tensorflow as tf
结果:冒出了一个错误,显示无法找到该模块。以及一连串的回溯失败,这下面是末尾的异常报错。以及一连串的回溯失败,这下面是末尾的异常报错。ImportError: DLL load failed: A dynamic link library (DLL) initialization routine failed.Failed to load the native TensorFlow runtime.See https://www.tensorflow.org/install/errorsfor some common reasons and solutions. Include the entire stack traceabove this error message when asking for help
方法1:
首先,conda install tensorflow==1.12.0
然后再,pip install tensorflow==1.12.0
亲测好使
方法2:pip install protobuf
未实验,查询解答,众说纷纭,记录一下
参考:https://download.csdn.net/download/weixin_38612139/14855057?utm_medium=distribute.pc_relevant_t0.none-task-download-2%7Edefault%7EBlogCommendFromMachineLearnPai2%7Edefault-1.base&depth_1-utm_source=distribute.pc_relevant_t0.none-task-download-2%7Edefault%7EBlogCommendFromMachineLearnPai2%7Edefault-1.base
二、opencv问题
1,AttributeError: module ‘cv2.cv2’ has no attribute ‘TrackerMOSSE_create’
opencv4.5目标跟踪时报错
方法1:
卸载之前安装的。
重新安装opencv-python , opencv-contrib-python ,一定要添加参数 --user,表示安装自本用户的目录下。
pip install opencv-python -i https://mirrors.aliyun.com/pypi/simple/
pip install --user -i https://mirrors.aliyun.com/pypi/simple/ opencv-contrib-python
方法2:
将cv2.TrackerMOSSE_create改成cv2.legacy.TrackerMOSSE_create
最新的opencv将这些跟踪算法从cv2库转移到cv2.legacy库中