
异常报错
清纯世纪
知识的搬运工
展开
-
skimage库报错:cannot import name ‘_validate_lengths‘
【代码】skimage库报错:cannot import name '_validate_lengths'原创 2024-10-30 10:47:58 · 411 阅读 · 0 评论 -
from typing_extensions import TypeAlias # Python 3.10+ModuleNotFoundError: No module named ‘typin
方案1:换python版本,我用的是3.8,但是换版本很麻烦,这个方案未使用。方案2:更新typing-extensions版本。原创 2024-10-29 17:53:43 · 640 阅读 · 0 评论 -
解决在Python中使用Win32api报错的问题:ImportError: DLL load failed: 找不到指定的程序。
下载后,双击pywin32-221.win-amd64-py3.7.exe,会识别Python的安装路径,一路Next安装即可。我们直接pip install pypiwin32,但是还是报错。原创 2024-09-26 10:38:18 · 597 阅读 · 0 评论 -
解决 git 不是内部或外部命令,也不是可运行的程序
右键“计算机”->“属性”->“高级系统设置”->“环境变量”->在下方的“系统变量”中找到“path”->选中“path”并选择“编辑”->将 复制的路径放到其中->保存并退出。注:"D:\Program Files\Git\"是默认安装路径,可能与你的安装路径不一样,要按照你自己的路径替换"D:\Program Files\Git\"但是如果这时你打开windows的cmd,在里面打git命令会提示“不是内部或外部命令,也不是可运行的程序”,即需要添加环境变量。再重新执行添加文件的命令即可。原创 2024-09-10 22:50:20 · 5471 阅读 · 0 评论 -
报错解决办法: Microsoft Visual C++ 14.0 or greater is required. Get it with “Microsoft C++ Build Tools“
1、首先下载:Microsoft Visual C++ Build Tools。然后,安装“使用C++的桌面开发”并确保安装详细信息的前两项勾选。二、安装:使用C++的桌面开发。安装好后重新pip安装库即可。原创 2024-09-10 22:26:22 · 11728 阅读 · 5 评论 -
报错:ValueError: assignment destination is read-only 的解决方案
【代码】报错:ValueError: assignment destination is read-only 的解决方案。原创 2024-03-27 22:57:20 · 1180 阅读 · 0 评论 -
忽略python运行出现的大量警告
【代码】忽略python运行出现的大量警告。原创 2023-12-05 22:11:37 · 439 阅读 · 0 评论 -
RuntimeError: set_sizes_contiguous is not allowed on a Tensor created from .data or .detach()
报错:原因:版本的问题解决方法:将替换成。原创 2023-10-27 15:11:54 · 232 阅读 · 0 评论 -
ImportError: libgthread-2.0.so.0: cannot open shared object file: No such file or directory
在linux服务器运行python报错:ImportError: libgthread-2.0.so.0: cannot open shared object file: No such file or directory CenOS系统原创 2023-10-26 22:00:49 · 234 阅读 · 0 评论 -
graphviz报错
大家习惯pip install graphviz去安装,但是是个软件,不能单独用。原创 2023-10-15 19:47:28 · 1448 阅读 · 1 评论 -
Pytorch深度学习训练模型保存问题,找不到保存路径
注意:这个代码在torch1.7版本无报错,但是在1.13.1版本报错。在linux好像也不报错。将文件路径的中文改成全英文就可以了。原创 2023-10-03 22:09:05 · 1810 阅读 · 0 评论 -
Pycharm中右键运行python程序时出现Run ‘pytest in XXX.py
新版本pycharm2022,调试程序的时候,无法进入__main__,最后发现是选择debug模式是pytest。主要原因是有个函数名为test。右键运行代码时和正常运行不一致,只执行单一函数test。右键菜单出现以下画面:“原创 2023-09-30 13:24:12 · 2005 阅读 · 0 评论 -
error: (-5:Bad argument) image is empty or has incorrect depth (!=CV_8U) in function ‘cv::SIFT_Impl:
sift的函数sift.detectAndCompute()函数要求输入图像必须由值为。所以在对图像使用sift之前,请使用以下内容将其转换为8位。义,这意味着它必须是CV_8U深度。0-255的8位整数定。原创 2023-06-15 17:52:37 · 1574 阅读 · 0 评论 -
虚拟机运行cv2报错Error: libgthread-2.0.so.0: cannot open shared object file: No such file or directory
在虚拟机或容器中运行Python文件报错ImportError: libgthread-2.0.so.0: cannot open shared object file: No such file or directory 解决方法。原创 2023-05-30 13:01:05 · 572 阅读 · 0 评论 -
win系统训练torch模型,报错:[Errno 32]Broken pipe
这是因为DataLoader中开启了多线程,将num_workers 删除或者改为1即可。原创 2023-05-11 07:58:54 · 253 阅读 · 0 评论 -
‘utf-8‘ codec can‘t decode byte 0xbe in position 0: invalid start byte问题解决方法
更改文件的编码方式即可。原创 2023-05-02 17:40:49 · 1428 阅读 · 0 评论 -
解决seaborn加载数据load_dataset()报错问题
主要是seaborn-data里面是空的(没有那些库文件数据,所以无法加载出来)原创 2023-04-10 09:56:49 · 1042 阅读 · 0 评论 -
‘ModelCheckpoint‘ object has no attribute ‘_implements_train_batch_hooks‘
代码】'ModelCheckpoint' object has no attribute '_implements_train_batch_hooks'原创 2022-08-11 10:52:00 · 708 阅读 · 0 评论 -
ValueError: Expected more than 1 value per channel when training, got input size ...
ValueError: Expected more than 1 value per channel when training, got input size…pytorch 在训练时使用多卡,会出现ValueError: Expected more than 1 value per channel when training, got input 这个错误由于batchnorm层需要大于一个样本去计算其中的参数,解决方法是将dataloader的一个...原创 2021-12-19 10:19:02 · 853 阅读 · 0 评论 -
pytorch/aten/src/THCUNN/ClassNLLCriterion.cu:108: block: [0,0,0], thread: [11,0,0] Assertion `t >= 0
调用交叉熵损失函数nn.CrossEntropyLoss()的时候报错。原因: nn.CrossEntropyLoss(input, target)中, input的列数和target不匹配举例来说, 如果是个5分类问题, 那么input的形状是batch_size * 5, target中每个元素的取值范围是{0,1,2,3,4}, 也就是[0, 类别数量减1]。所以对于n分类问题来说, 如果target中某个元素的取值不在[0,n-1]中就会...原创 2021-12-19 10:00:08 · 3208 阅读 · 0 评论 -
解决TypeError: a bytes-like object is required, not ‘str‘
原代码:box.split(',')改成:box.decode().split(',')解决原创 2021-11-26 17:40:04 · 277 阅读 · 0 评论 -
异常报错:BrokenPipeError: [Errno 32] Broken pipe
这个错误代码是 32 ,纠结了很久,尝试过很多方法,最后才想起是多线程问题,,只需修改 num_work=0 或 1 就可以正常运行了修改为:原创 2021-11-26 17:28:29 · 3079 阅读 · 0 评论 -
Python中读取txt文本出现“ ‘gbk‘ codec can‘t decode byte 0xbf in position 2: illegal multibyte sequence”的解决办法
此种错误,可能是要处理的字符串本身不是gbk编码,但是却以gbk编码去解码 。比如,字符串本身是utf-8的,但是却用gbk去解码utf-8的字符串,所以结果不用说,则必然出错。 加上读取方式 'rb' 即可。path = 'D://Document And Settings3/lqz/Desktop/Walden.txt'file = open(path, 'rb')print(file.read())...原创 2021-11-26 17:26:33 · 2152 阅读 · 0 评论 -
Python:ModuleNotFoundError:没有名为‘tqdm.notebook‘的模块
tqdm已经安装在我的环境中,但我仍然面临这个问题。更新升级tqdm解决了该错误.pip install tqdm --upgrade原创 2021-11-26 11:32:11 · 2211 阅读 · 1 评论 -
SSD报错:The shape of the mask [32, 8732] at index 0does not match the shape of the indexed tenso
IndexError: The shape of the mask [32, 8732] at index 0does not match the shape of the indexed tensor [279424, 1] at index 0如果出现类似于以上的索引错误,需要将layers/modules/multibox_loss.py 的代码按照下图修改即可。注释掉的是源代码,下面的是新加的,即交换两行代码的顺序即可。解决了这个问题,又会出现一个新问题:IndexError:.原创 2021-11-26 11:09:48 · 4569 阅读 · 0 评论 -
解决SSD报错:Legacy autograd function with non-static forward method is deprecated.
报错记录:Traceback (most recent call last): File "eval.py", line 438, in <module> thresh=args.confidence_threshold) File "eval.py", line 385, in test_net detections = net(x).data File "D:\Anaconda3\lib\site-packages\torch\nn\modules\modu...原创 2021-11-26 11:05:41 · 2520 阅读 · 1 评论