python错误合集
|晴天|
这个作者很懒,什么都没留下…
展开
-
pytorch运行错误:RuntimeError: cuDNN error: CUDNN_STATUS_INTERNAL_ERROR
发现了解决该问题的方法:(特别是实验室服务器单机多卡的情况)TensorFlow时代的做法是,import osos.environ['CUDA_ENABLE_DEVICES'] = '0'但是该方法在**Pytorch**代码并不适用,正确的操作方法是:import torchtorch.cuda.set_device(0)————————————————...原创 2020-06-26 20:14:48 · 10566 阅读 · 6 评论 -
pip install yaml
问题pip install yamlERROR: Could not find a version that satisfies the requirement yaml (from versions: none)ERROR: No matching distribution found for yaml结果第一种直接安装pip install pyyaml第二种下载pyyaml的安装包,进行手动路径安装# pip install 路径pip install H:\PyYAML-原创 2020-06-21 09:51:03 · 19877 阅读 · 0 评论 -
ValueError: Object arrays cannot be loaded when allow_pickle=False
错误使用numpy的函数 numpy.load() 加载数据时报错:ValueError: Object arrays cannot be loaded when allow_pickle=False自Numpy 1.16.3版本发行之后,函数 numpy.load() 和 numpy.lib.format.read_array() 采用allow_pickle关键字,现在默认为False以响应CVE-2019-6446 < nvd.nist.gov/vuln/detail / CVE-201原创 2020-06-20 19:26:07 · 164 阅读 · 0 评论 -
pip通过指镜像安装依赖包——清华镜像等
此处以清华源为例:直接安装pip install scikit-learn指定版本号pip install scikit-learn==0.19.2指定版本号和来源pip install scikit-learn==0.19.2 -i https://pypi.tuna.tsinghua.edu.cn/simple/...原创 2020-04-21 11:46:47 · 870 阅读 · 0 评论 -
python解决No Module Named arcpy问题
将路径添加到模块搜索路径import syssys.path.append(r"C:\Program Files (x86)\ArcGIS\Desktop10.2\arcpy")import arcpy添加之后就可以正常调用arcpy了只适合于单次添加模块...原创 2020-03-14 14:08:34 · 2629 阅读 · 1 评论 -
运行pip指令时相关错误解决方法
那么就用下面的命令来强制重装 pip:python3 -m pip install --upgrade --force-reinstall pippython2 -m pip install --upgrade --force-reinstall pip至此就解决了pip的错误。原创 2019-09-09 21:19:04 · 1271 阅读 · 1 评论 -
import cv2的安装
>>>pip3 install cv2 Collecting cv2 ERROR: Could not find a version that satisfies the requirement cv2 (from versions: none) ERROR: No matching distribution found for cv2没有找到cv2应该安装openc...原创 2019-09-01 15:56:14 · 2711 阅读 · 0 评论 -
Python读取文件时出现UnicodeDecodeError: 'gbk' codec can't decode byte 0x80 in position 7236: XXX的解决方案
Python在读取文件时with open(‘article.txt’, “a”) as f: # 打开新的文本data = f.read() # 读取文本数据出现错误:UnicodeDecodeError: ‘gbk’ codec can’t decode byte 0xaa in position 7236: illegal multibyte sequence解决办法:wit...原创 2019-05-29 15:17:24 · 2661 阅读 · 0 评论 -
python os.path模块常用方法详解
python os.path模块常用方法详解官方文档:http://docs.python.org/library/os.path.html1.os.path.abspath(path)返回path规范化的绝对路径。os.path.abspath(‘test.csv’)‘C:\Python25\test.csv’os.path.abspath(‘c:\test.csv...转载 2019-05-29 15:25:25 · 145 阅读 · 0 评论