问题摘录
小舞O_o
视觉进阶小白
展开
-
scipy.io.loadmat加载.mat文件,出现KeyError: ‘xxx‘
input_image = loadmat(r'C:\Users\admin\Downloads\Indian_Pines\SVM/aa.mat')['imggt'] #影像图。input_image = loadmat(r'C:\Users\admin\Downloads\Indian_Pines\SVM/aa.mat')['aa'] #影像图。因为loadmat函数读取出来的高光谱数据是dict格式的所以需要定位才能进行后续操作,定位通常是通过列名,所以找到正确的列名,并修改源代码,问题就能解决。原创 2024-06-04 17:04:26 · 52 阅读 · 0 评论 -
ModuleNotFoundError: No module named ‘osgeo‘
方法2:官网下载失败,下载地址:https://www.lfd.uci.edu/~gohlke/pythonlibs/#gdal。确保你已经安装了正确的依赖项,例如GDAL、GEOS和PROJ等。方法3:conda install gdal 成功。方法1:pip install gdal 失败。pip install osgeo显示失败。显示无osgeo模块。原创 2024-05-29 16:24:56 · 145 阅读 · 0 评论 -
Error opening file a bytes-like object is required,not ‘NoneType‘
查看json文件内容,索引的路径与json文件保存的路径不同。方法:使用python脚本统一修改json文件路径。错误显示,打开的是一个无效路径的文件。原创 2024-04-25 18:11:50 · 265 阅读 · 0 评论 -
ImportError: cannot import name ‘tabulate‘ from partially initialized module ‘tabulate‘
类似的错误:ImportError: cannot import name 'xxx' from partially initialized module 'xxxx'在根目录中有和库重名的.py文件,更换命名就可以了。原创 2024-04-02 15:02:21 · 145 阅读 · 0 评论 -
Ubuntu系统下查看安装的CUDA和CUDNN的版本
【代码】Ubuntu系统下查看安装的CUDA和CUDNN的版本。原创 2024-03-12 16:24:50 · 827 阅读 · 0 评论 -
图片脚本排序出现如下错误
问题:FileExistsError: [WinError 183] 当文件已存在时,无法创建该文件。: 'instrument/instrument_10.jpg' -> 'instrument/instrument_2.jpg'解决方法:1.将文件夹中所有图片命名为a;2.重新在cmd Python环境下python renames.py(脚本)一下。...原创 2022-04-21 10:48:59 · 2186 阅读 · 0 评论 -
Pytorch训练时,无法使用gpu多线程加载图片
多线程图片加载是使用 cpu,非gpu时,需重新下载pytorch gpu版:1.conda list命令(上图torch显示版本是:1.6.0+cu101,如果你显示的是1.6.0,表示你安装的是cpu版本)2.链接https://pytorch.org/get-started/previous-versions/去搜寻对应版本装载,pip install torch==1.9.0+cu102 torchvision==0.10.0+cu102 torchaudio==0原创 2022-04-22 14:39:53 · 3634 阅读 · 1 评论 -
yolox训练时出现 R = [obj for obj in recs[imagename] if obj[“name“] == classname]的数据集问题
删除./VOCdevkit\annotations_cache\VOC2007\test文件夹下的.pkl文件即可原创 2022-05-05 09:51:56 · 405 阅读 · 0 评论 -
TypeError: Cannot handle this data type: (1, 1, 3), <f8和Image.fromarray()函数转换后图像失真
错误显示1.错误显示2.(预测为RGB图像,结果失真为黑色)原因:采用 matplotlib.image 读入图片数组,注意这里读入的数组是 float32 型的,范围是 0-1,而 PIL.Image 数据是 uinit8 型的,范围是0-255(可根据python PIL图像处理 - jujua - 博客园 (cnblogs.com)分析)更改方案:...原创 2022-05-18 11:07:48 · 8367 阅读 · 1 评论 -
Serialization assertion safeVersionRead == safeSerializationVersion failed.
[TensorRT] ERROR: 1: [stdArchiveReader.cpp::StdArchiveReader::35] Error Code 1: Serialization (Serialization assertion safeVersionRead == safeSerializationVersion failed.Version tag does not match. Note: Current Version: 0, Serialized Engine Version: 89)原创 2022-10-11 10:05:18 · 3102 阅读 · 0 评论 -
【无标题】NO module named ‘yaml‘
解决方案: pip install -i https://pypi.tuna.tsinghua.edu.cn/simple --trusted-host pypi.tuna.tsinghua.edu.cn pyyaml。安装: conda install -c conda-forge yaml。再次运行情况:显示:NO module named 'yaml'问题显示:NO module named 'yaml'验证:conda list 显示已安装yaml。原创 2023-05-09 10:51:46 · 162 阅读 · 0 评论 -
to.(device) AttributeError: ‘list‘ object has no attribute ‘to‘
测试显示:print("6666666666666666666 ",target))在错误点前输入:target=torch.stack(target, dim=1)解决方案:将列表元素取出(即list类型转换成tensor类型,将。原创 2023-05-18 10:54:30 · 3561 阅读 · 2 评论 -
ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resoluti
pip install basicsr 或pip install pymysql -i https://pypi.tuna.tsinghua.edu.cn/simple/出现如下错误,无法安装。解决方法:网速的原因,采用国内的镜像源来加速。原创 2023-06-20 00:07:04 · 5817 阅读 · 1 评论 -
evaluate_object.cpp:12:10: fatal error: boost/numeric/ublas/matrix.hpp: 没有那个文件或目录
单目3D检测M3D-RPN项目,kitti.tar 数据集运行过程问题原创 2023-09-27 11:12:17 · 211 阅读 · 1 评论 -
ModuleNotFoundError: No module named ‘ultralytics.utils‘
使用多个yolov5项目,或者yolo项目,相互调用时,下级推理程序会直接调用上级(即根目录下)的程序文件,例如:下级推理文件会直接调用上级模型项目中utils包中的plots.py,而不会调用同级目录下的utils包。当上级项目目录下的程序文件发生变化更改时,就会发生调用错误。1)使用export.py文件导出best.onnx文件。使用onnx的权重格式,代替.pt格式。原创 2024-01-16 12:44:45 · 3342 阅读 · 1 评论 -
github 无法打开解决方法
github 无法打开解决方法原创 2024-01-18 22:32:48 · 401 阅读 · 0 评论 -
RuntimeError: stack expects each tensor to be equal size, but got [3, 354, 129] at entry 0 and [3, 1
【代码】RuntimeError: stack expects each tensor to be equal size, but got [3, 354, 129] at entry 0 and [3, 1。原创 2024-02-06 10:31:56 · 220 阅读 · 0 评论 -
error: (-209:Sizes of input arguments do not match) The operation is neither ‘array op array‘ (where
在图像融合时,以下几种图像运算方式需要输出的图像–必须与输入的图像具有相同的大小、类型和通道数。图像异或运算cv2.bitwise_xor(src1,src2,dst,…图像与运算cv2.bitwise_and(src1,src2,dst,…图像非运算cv2.bitwise_not(src1,src2,dst,…图像或运算cv2.bitwise_or(src1,src2,dst,…图像减法运算cv2.subtract(src1,src2,dst,…图像加法运算cv2.add(src1,src2,dst,…原创 2024-02-20 20:09:39 · 586 阅读 · 0 评论 -
YOLOv5推理时出现:assert im0 is not None, f‘Image Not Found {path}‘
在yolon5模型训练、验证时如果遇到位深度不足24的图片则会出现如下图过滤信息,代表此张图不使用;datect.py推理则会直接报错停测,如出现标题主题的现象。可以查看到此张图的位深度为8,按如下表格分析到此张图为位图模式、灰度图或者r\g\b单通道图片等。在图片批量使用前,使用文件位深度排序方式删除位深度不足24的图像数据,步骤如下;Python将8位的图片转为24位的图片。将dataset中的第161行。原创 2024-02-23 11:13:20 · 530 阅读 · 2 评论 -
批量解决opencv cv2.imread读取32位抠图png图像后,出现隐藏背景无法去除的问题
1.原始png含蒙版抠图信息:位深度为32位,4通道图像信息,含蒙版背景信息2.使用opencv读取保存后图像信息:位深度为24位,3通道图像信息,显示了扣除的背景。原创 2024-02-26 14:00:55 · 996 阅读 · 0 评论 -
RuntimeError: The size of tensor a (4) must match the size of tensor b (3) at non-singleton dimensio
更改后全为.jpg格式图像,image = Image.open(imagepath)可以直接读取图像数据。图像数据包含.png和.jpg格式,不统一,Image.open()函数无法直接读取.png格式的图片。2.先更改图片格式为.jpg再运行图片读取程序。原创 2024-03-05 18:40:00 · 784 阅读 · 0 评论