
程序错误
studyeboy
这个作者很懒,什么都没留下…
展开
-
Github上git clone失败:Failed to connect to github.com port 443: Connection timed out
网页上使用VPN可以打开github,说明在拉取代码时没有使用VPN进行代理。使用客户端的VPN,设置服务器使用客户端的VPN。原创 2024-01-17 11:17:24 · 1151 阅读 · 0 评论 -
RuntimeError: GET was unable to find an engine to execute this computation
CUDA版本是11.1,虚拟环境中安装的torch是2.0.0,首先调用torch出现问题。在该虚拟环境中重新安装torch,还是没生成nvidia这个文件。从其他的文件中将文件拷贝到虚拟环境的对应包下。检测torch和cuda是否能用。解决上述问题后又出现问题。检查cudnn是否可用。原创 2023-12-27 15:26:22 · 8971 阅读 · 2 评论 -
RuntimeError: Inference tensors do not track version counter.
【代码】RuntimeError: Inference tensors do not track version counter.原创 2023-12-20 16:07:55 · 867 阅读 · 0 评论 -
AssertionError: CUDA_HOME does not exist, unable to compile CUDA op(s)
安装完之后检测,重新安装,成功安装。原创 2023-08-01 10:48:32 · 7592 阅读 · 2 评论 -
CondaHTTPError:HTTP 000 CONNECTION FAILED
【代码】CondaHTTPError:HTTP 000 CONNECTION FAILED。原创 2023-08-01 09:42:58 · 249 阅读 · 0 评论 -
gnutls_handshake() failed: The TLS connection was non-properly terminated.
从远程仓库获取所有更新,并保存在本地时,使用。原创 2023-06-30 17:00:02 · 490 阅读 · 0 评论 -
ImportError: libcupti.so.11.7:cannot open shared object file: No such file or directory
从其他的文件中将文件拷贝到虚拟环境的对应包下。问题:虚拟环境中程序执行时出现。在该虚拟环境中重新安装。原创 2023-06-09 09:36:54 · 3723 阅读 · 1 评论 -
打印异常信息所在的文件和位置
printl可以打印异常信息,但是对于异常信息所在的文件和位置需要使用下面的方法进行打印参考资料Python中获取异常(Exception)信息原创 2022-12-07 11:06:59 · 410 阅读 · 0 评论 -
json序列化
总结:使用jsonify时相应的Content-Type字段值为application/json,而使用json.dumps时该字段值为text/html。,检查页面属性查看Response内容,按F2->点击网络->Ctrl+R->选择标头可以看到返回值的类型。,检查页面属性查看Response内容,按F2->点击网络->Ctrl+R->选择标头可以看到返回值的类型。如果是使用服务器,端口号虽然是零但是必须要写,否则会出错,出现连接不到网络的问题。,而json.dumps方法需要添加参数。原创 2022-11-04 11:07:49 · 334 阅读 · 0 评论 -
HTTP请求头headers
urllib是Python内置的库,requests是对urllib的再次封装。在使用上更加便捷。下载网络图片到本地不加headers信息可能会造成服务器拒绝下载网络图片到本地。或者是只能下载https协议的url图片,不能下载http协议的url图片。urllib方法方法一import urllib#from urllib import requestdef add_header_to_retrieve(): headers=('User-Agent','Mozilla/5.0原创 2022-02-28 16:48:29 · 2972 阅读 · 0 评论 -
Python中NaN的处理
px = [int(i) for i in element.get('polygon_x').split(" ")]py = [int(i) for i in element.get('polygon_y').split(" ")]pdraw.polygon(list(zip(px,py)), fill=colormap[label], outline=colormap[label])上面的代码在处理包含NaN数据和2.155000e+02数据时会出错。NaN和2.155000e+02对应的数据类.原创 2022-01-25 10:55:47 · 3454 阅读 · 0 评论 -
ModuleNotFoundError: No module named ‘onnxsim‘
解决方法: pip install -U onnx-simplifier --user原创 2022-01-14 10:15:22 · 6172 阅读 · 0 评论 -
git clone时gnutls_handshake() failed: The TLS connection was non-properly terminated
主要是代理设置的问题。参考资料跳坑 gnutls_handshake() failed: The TLS connection was non-properly terminated.解决拉取github仓库报错“gnutls_handshake() failed”问题原创 2022-01-12 15:27:01 · 980 阅读 · 0 评论 -
PIL.UnidentifiedImageError:cannot identify image file ‘xxx.jpg‘
问题当图像大小为0KB时,使用下面的代码读取图像时出现如下错误。from PIL import Image img = Image.open('xxx.jpg')if img is None: print('read image failed!')解决方法from PIL import Imagetry: img = Image.open('xxx.jpg')except Exception: print('read image failed!')...原创 2021-12-29 13:29:02 · 1704 阅读 · 0 评论 -
Unexpected version found while deserializing dlib::shape_predictor
问题解决方法原创 2021-12-10 15:53:26 · 540 阅读 · 1 评论 -
dlib安装:Command errored out with exit status 1
问题解决原创 2021-12-06 15:03:03 · 1222 阅读 · 0 评论 -
Image size (xxx pixels) exceeds limit of 178956970 pixels, could be decompression bomb DOS attack.
问题描述原因图片过大,超过178956970 像素。解决方案图像缩放处理对读入图像尺寸进行判断,超过178956970 像素的图像进行缩放处理。修改最大像素值。from PIL import ImageFileImageFile.LOAD_TRUNCATED_IMAGES = TrueImage.MAX_IMAGE_PIXELS = None参考资料解决Pillow报错 Image size (XXX pixels) exceeds limit of 178956970 pix原创 2021-12-06 09:47:47 · 2804 阅读 · 0 评论 -
The TLS connection was non-properly terminated.
问题解决方法原创 2021-12-03 16:20:46 · 2777 阅读 · 0 评论 -
TensorFlow2.x和TensorFlow1.x版本冲突问题解决
问题描述:问题分析安装的是TensorFlow2.0但是使用的是TensorFlow1.0版本的代码。解决办法把整个TensorFlow2.0的调用转换为TensorFlow1.0的调用,无需对单个函数就行修改。#import tensorflow as tf #2021-11-03 tensorflow2.0 version#2021-11-03 tensorflow 2.0 version using version 1.x method import tensorflow.co原创 2021-11-04 09:46:00 · 1500 阅读 · 0 评论 -
ModuleNotFoundError:No module named ‘tensorflow.contrib’
问题描述:问题原因:tensorflow2以上的版本没有contrib属性解决办法:下载镜像包tf_slim将import tensorflow.contrib.slim as slim改为import tf_slim as slim参考资料不降级解决ModuleNotFoundError: No module named ‘tensorflow.contrib‘...原创 2021-11-03 17:36:39 · 2733 阅读 · 0 评论 -
ValueError: At least one stride in the given numpy array is negative
问题:解决方法:改为:原创 2021-10-09 11:25:19 · 3079 阅读 · 0 评论 -
Assertion `input_val >= zero && input_val <= one` failed
问题:解决方法:改成:原创 2021-10-08 14:30:16 · 1256 阅读 · 0 评论 -
list去除某一个元素后剩下的元素求和的bug
根据值进行判断,这种方法对于list中有相同数值的数时,计算出来的结果是错误的。例如:list为[434, 434, 195],max_idx=0, max_value=434,计算结果为195,非629.sum(y for y in imgs_scale_h if imgs_scale_h.index(y) != max_idx) + inter_pix)根据索引进行判断,该方法计算结果比较稳定。sum(imgs_scale_h[j] for j in range(len(imgs_scale_h原创 2021-05-21 11:01:40 · 338 阅读 · 0 评论