自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(109)
  • 收藏
  • 关注

原创 ModuleNotFoundError: No module named ‘PySide‘;qtpy.PythonQtError: No Qt bindings could be found

labelme_json_to_dataset apc2016_obj3.json -o apc2016_obj3_json出现如下错误Traceback (most recent call last): File "/home/shaorenjie/.conda/envs/assemblenet/lib/python3.6/site-packages/qtpy/__init__.py", line 223, in <module> from PySide import __v

2021-11-17 13:06:31 1980

原创 python批量labelme_json_to_dataset(批量执行命令)

import osimport subprocessdef json_to_folder(input_json): output_folder = input_json.replace(".","_") cmd = ["labelme_json_to_dataset", input_json, "-o", output_folder] subprocess.call(cmd)

2021-11-04 09:38:36 745

原创 c++ 获取文件夹所有文件

实测有效#include<io.h>void getFiles(std::string path, std::vector<std::string>& files){ //文件句柄 long long hFile = 0; //文件信息 struct _finddata_t fileinfo; std::string p; if ((hFile = _findfirst(p.assign(path).append("\\*").c_str(), &a

2021-11-03 16:39:30 665

原创 linux/ubuntu安装protobuf最简单的方法(无需编译)

参考https://gist.github.com/ryujaehun/991f5f1e8c1485dea72646877707f497下载protoc-3.6.0-linux-x86_64.ziphttps://github.com/protocolbuffers/protobuf/releases/tag/v3.6.0unzip protoc-3.6.0-linux-x86_64.zip -d protoc-3.6.0sudo mv protoc-3.6.0/bin/* /usr/local/b

2021-07-26 14:36:02 455

原创 linux修改文件夹权限 group owner(chmod chown chgrp)

sudo chmod -R 777 directorysudo chown -R username directorysudo chgrp -R username directory

2021-07-21 10:59:33 1071

原创 signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0(Cause: null pointer dereference)

问题描述:基于mnn编译的面向安卓平台的模型推理so动态在android studio调用其推理函数时报空指针错误(完整错误输出在最后),且错误行在于mnn推理输出的指针数组元素的判断语句(如下代码),但之前使用其他模型时加入类似语句并未报错,所以猜测问题出在了模型上面int* output_tensor_array = output_tensor->host<int>();output_tensor_array[col + 1024 * row] == 2 //此处为addr2li

2021-07-12 14:56:17 3377

原创 编译opencv出现Could NOT find PythonLibs: Found unsuitable version “3.6.9“, but required is exact version

解决:在cmake后面加上 -DPYTHON3_LIBRARY=../anaconda3/envs/your_envs_name/lib/libpython3.6m.so参考https://stackoverflow.com/questions/47237098/opencv-cmake-could-not-find-pythonlibs-found-unsuitable-version-ubuntu

2021-06-30 09:35:34 1757 1

原创 linux安装cuda出现You appear to be running an X server; please exit X before installing.错误

使用runfile安装cuda出现如下错误sudo sh cuda_11.2.0_460.27.04_linux.runnvidia-installer log file '/var/log/nvidia-installer.log'creation time: Tue Jun 29 11:06:31 2021installer version: 460.27.04PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bi

2021-06-29 13:26:48 2078

原创 使用ncnn在c++对onnx进行推理

从https://github.com/Tencent/ncnn/tags选个最新windows平台编译好的shared版本下载,里面的头文件文件夹,dll,lib直接配置到项目即可(build from source一堆错误。。。)

2021-06-10 17:46:16 1903 3

原创 openvino windows下安装配置并在c++中加载onnx模型进行推理

openvino安装步骤https://docs.openvinotoolkit.org/latest/openvino_docs_install_guides_installing_openvino_windows.html#Update-Path错误1 安装程序没找到python和gpu在安装openvino过程会遇到这样的错误,不用管直接继续安装(电脑已经安装anaconda python 3.6),之后在cmd执行Configure the Model Optimizer命令的时候会找到pyth

2021-06-09 17:13:22 2815 6

原创 yolov4 使用mnn在c++部署

概要1.使用的是AlexeyAB版的darknet(https://github.com/AlexeyAB/darknet/)在windows下进行训练得到.weights2.将训练时的.cfg文件和训练后得到的.weights文件根据https://github.com/Tianxiaomo/pytorch-YOLOv4转onnx3.将onnx文件转mnn格式4.在c++中调用mnn文件进行目标检测详细在步骤2转换得到的onnx文件使用onnxruntime推理输出两个数组,第一个数组的sha

2021-06-07 15:44:52 1313 1

原创 sinet阅读笔记

sinet(超轻量级的分割网络,需要在app中运行):1.Information Blocking Decoder(设计初衷是因为像unet为了增加解码部分特征图的语义信息会将编码部分同样形状的特征图直接作用到编码部分特征图上,编码部分特征图可能含有噪声,这些噪声会在后续编码部分消除,所以这些噪声在恢复图片时是不想要的;具体实现是先将编码部分的输出通过pointwise conv生成通道数和类别数目相同的特征图,再把特征图放大到对应加过来的编码部分特征图的形状(长和宽一样),通过对该解码部分特征图每个通道

2021-05-28 13:53:38 1686

原创 不同颜色对应不同物体的mask轮廓提取并把所有轮廓在原图上展示(opencv)

import numpy as npimport cv2imbgr = cv2.imread('.../43.png')imgray = cv2.imread('.../43_mask.png',0)# 以灰度图读取mask图片,那么不同物体对应的像素值是不同的,提取统一像素值的所有位置# mask中物体1的像素值为78,设定像素范围来获取所有坐标upper1=imgray<=80lower1=imgray>=70thresh1=(np.multiply(upper1,low

2021-05-27 18:45:00 2097 1

原创 yolo-darknet make报错/usr/lib/x86_64-linux-gnu/libopencv_highgui.so:对‘’未定义的引用

sudo make

2021-05-24 09:14:45 334

原创 转化yolov2的weights和cfg文件到onnx

修改https://github.com/purelyvivid/yolo2_onnx/blob/master/darknet.py 151行为pad = int((kernel_size-1)/2) if is_pad else 0在https://github.com/purelyvivid/yolo2_onnx/blob/master/Onnx.py中的最下方添加如下代码转化yolov2的weights和cfg文件到onnxdef onnx_file_export(model, onnxfil

2021-05-19 11:07:07 938

原创 Could NOT find CURL (missing: CURL_LIBRARY CURL_INCLUDE_DIR);CMAKE_USE_SYSTEM_CURL is ON but a curl

linux安装cmake并连接system-curlwget https://cmake.org/files/v3.13/cmake-3.13.2.tar.gztar xvf cmake-3.13.2.tar.gzcd cmake-3.13.2./bootstrap --system-curlmakesudo make install出现如下错误-- Could NOT find CURL (missing: CURL_LIBRARY CURL_INCLUDE_DIR)CMake Err

2021-05-13 11:23:05 3754

原创 Could not find toolchain file: /build/cmake/android.toolchain.cmake

https://mace.readthedocs.io/en/latest/user_guide/basic_usage_cmake.html根据mace的步骤执行.sh文件时出现以下错误CMAKE_VERSION: 3.11.3CMake Error at /usr/local/share/cmake-3.11/Modules/CMakeDetermineSystem.cmake:100 (message): Could not find toolchain file: /build/cmake

2021-05-13 09:45:32 7199 2

原创 mnn在c++中的推理demo(mnn不支持5维输入,即暂时不支持3dcnn的推理)

准备工作1.使用cmake-gui在windows下编译mnn得到MNN.dll和MNN.lib(Release x64)2.opencv的dll,lib,头文件可以在https://github.com/opencv/opencv/releases/tag/4.3.0的opencv-4.3.0-vc14_vc15.exe直接安装后得到,不用编译(opencv_world430.dll,opencv_world430.lib)3.在vs2017中include mnn和opencv的所需要头文件(mn

2021-05-12 15:25:07 1050 1

原创 sudo apt-get autoremove的补救

由于linux上cmake版本较低需要更新,参考了https://blog.csdn.net/ykwjt/article/details/88353622,使用了坑爹的apt-get autoremove命令卸载老版本cmake(如下命令)sudo apt-get autoremove cmake导致cmake的一堆依赖都被卸载,再重新按照该博文安装cmake出现大量报错。其实没必要执行这一步,按照博文的其他步骤直接安装新版本即可补救方法:https://zhuanlan.zhihu.com/p/

2021-05-12 14:47:24 4883 1

原创 AttributeError: module ‘onnxruntime‘ has no attribute ‘InferenceSession‘

因为py文件名字被我命名成了onnxruntime.py与python库onnxruntime重名了,修改onnxruntime.py为onnxruntime_test.py再执行就好了。。。

2021-04-28 19:20:06 1534

原创 .ibtoolize: error: AC_CONFIG_MACRO_DIRS([m4]) conflicts with ACLOCAL_AMFLAGS=-I m4

https://stackoverflow.com/questions/47582762/ac-config-macro-dirsbuild-aux-m4-conflicts-with-aclocal-amflags-i-build-aux问题描述:从win10下的github desktop git clone protobuf,然后把文件夹穿到linux平台的服务器再运行.sh文件产生如下错误libtoolize: putting auxiliary files in AC_CONFIG_AUX_

2021-03-17 16:56:29 3779 3

原创 tensorflow对模型的权重进行l2正则化(l2 regularization/weight decay)

这里仅对卷积的权重进行l2正则化,biases的权重可以通过根据名称搜索biases的变量,添加变量到regularized_weights即可regularized_weights=[]for val in tf.global_variables(): if 'conv_3d/w:0' in val.name: regularized_weights.append(val)regularizer = tf.contrib.layers.l2_regularizer(0.000

2021-03-17 16:33:44 858

原创 OHEM,Focal loss,GHM loss二分类pytorch代码实现(减轻难易样本不均衡问题)

https://mp.weixin.qq.com/s/iOAICJege2b0pCVxPkvNiA综述:解决目标检测中的样本不均衡问题该综述主要介绍了OHEM,Focal loss,GHM loss;由于我这的二分类数据集不存在正负样本不均衡的问题,所以着重看了处理难易样本不均衡(正常情况下,容易的样本较多,困难的样本较少);由于我只是分类问题,所以写了各种分类的loss,且网络的最后一层为softmax,所以网络输出的pred是softmax层前的logits经过softmax后的结果,普通的交叉熵损

2020-10-16 16:49:44 5170 3

原创 图神经网络GCN,GraphSAGE,GAT简述

图的两大要素:node(顶点),edge(边,即顶点与顶点之间的连接)GCN,GraphSAGE,GAT均是在Weisfeiler-Lehman (WL-1)算法的基础上修改了每个iteration顶点更新的方程,都是通过使用与某个顶点相连的顶点来不断更新该顶点的特征向量Weisfeiler-Lehman (WL-1)算法GCNSEMI-SUPERVISED CLASSIFICATION WITH GRAPH CONVOLUTIONAL NETWORKSGCN将for循环的hash函数换成了其他

2020-10-16 15:37:57 2393

原创 CrossEntropyLoss,BCEWithLogitsLoss,BCEWithLogitsLoss细节(给不同的样本赋予不同的权重;给不同类别的样本赋予不同的权重)

torch.nn.BCELoss,torch.nn.BCEWithLogitsLoss中的weight参数和torch.nn.CrossEntropyLoss的weight参数意义不一样,torch.nn.CrossEntropyLoss,torch.nn.BCEWithLogitsLoss的weight是每个class的权重,torch.nn.BCELoss中的weight是每个样本的权重;torch.nn.BCEWithLogitsLoss对于输入都要做一个sigmoid操作再做average(-ylo

2020-10-15 11:03:30 2467

原创 nvidia-smi显示某个gpu没有进程但依然占有显存

具体参考:https://forums.developer.nvidia.com/t/11-gb-of-gpu-ram-used-and-no-process-listed-by-nvidia-smi/44459如上图所示,索引为2的GPU在下面没有进程但在上面依然占有显存解决方法:使用sudo fuser -v /dev/nvidia*查看所有gpu的进程,然后找到对应索引2的GPU的进程,kill所有对应进程,如下图就是sudo kill 6810...

2020-08-04 16:07:23 2352

原创 TPN概述及训练(Temporal Pyramid Network for Action Recognition)(更新中)

参考:https://zhuanlan.zhihu.com/p/127366929TPN时间金字塔网络的概述,大概就是时间维度不变的3d resnet,再对不同层的输出进行空间维度对齐,再对这些对齐后的特征采用不同帧采样(因为不同层输出的时间维度不变),再进行对这些特征的融合后进行分类;具体和slowfast的概念相似,slowfast只有两个网络对应不同帧频,而TPN想要在不增加网络(计算量)的情况下融合更多的帧频的特征,但是TPN融合的一个模型各个层不同帧频的特征;...

2020-07-29 10:34:38 2079

原创 pyslowfast multigrid训练自己的数据集(没有把网络模型给抠出来再按照自己的训练,而是完全按照作者的代码命令训练)

安装:具体参考https://github.com/facebookresearch/SlowFast/blob/master/INSTALL.md注意点:1.使用conda install pytorch torchvision cudatoolkit=9.2在自己服务器的虚拟环境下安装pytorch时需要使得cudatoolkit与驱动版本(使用nvidia-smi查看)相匹配,不然torch.cuda.is_available()返回false使得安装的pytorch无法使用gpu加速;版本配对

2020-07-21 19:03:23 2792 6

原创 torch.cuda.is_available()返回false

按照https://pytorch.org/使用下列命令安装pytorch时cudatoolkit版本写10.0,不要写10.1或10.2(1.3 1.4和10.0配对时torch.cuda.is_available()正常)conda install pytorch torchvision cudatoolkit=10.0

2020-07-16 09:04:20 377

原创 git clone出现fatal: bad config file line 1 in .../.git/config错误

服务器加密系统的原因,之前还好好的,之后加完密就出现这种错误了搜索后,发现最常见的下列解决方法是无效的,因为之前服务器可以git clone的时候没有设置这些就能运行,所以和下列配置无关 git config --global user.name "your name" git config --global user.email "your email"...

2020-07-14 08:25:18 1824 1

原创 E:Unable to locate package

bing和百度搜了一圈,大多是以下的回答sudo apt-get updatesudo apt-get upgrade然而并没有用即使是https://blog.csdn.net/a921122/article/details/22965429/中在/etc/apt/sources.list文件里面增加一堆东西再sudo apt-get update也还是没有用最后!!!我把另一个服务器/etc/apt/sources.list文件拷到出问题的服务器上再sudo apt-get update就好

2020-07-10 12:54:32 411

原创 windows使用ssh连接服务器闲置过长后断开连接(Connection reset by server-ip port 22)

问题描述:最近下班前连接服务器训练模型开在那儿,一般第二天来都能继续训练不会断,但最近莫名其妙第二天来看的时候训练已经断了参考:https://blog.csdn.net/paincupid/article/details/91358564https://blog.csdn.net/u012222248/article/details/83060660上述第二篇博客写的使用的一种方法比较详细,第一篇博客写的方法中实际可以尝试的感觉也就只有两种方法一(在第二篇博客中写的比较详细)和方法四,且在方法四

2020-07-10 10:35:38 1450

原创 GEMS_Ultrasound_MovieGroup_001(python下进行private tag data(private creator)数据提取)

主要是通过查看pydicom读取dicom文件的输出查找存储视频的array和图片的长和宽try: dataset = pydicom.dcmread(dicom_file_path)except: print('unreadable dcm file!') continuetry: patient_id = dataset[0x0010, 0x0020].valueexcept: print('no patient id in dcm!') con

2020-07-07 13:36:02 518

原创 Counting Out Time: Class Agnostic Video Repetition Counting in the Wild个人笔记

参考https://mp.weixin.qq.com/s/olVWrq0Dca2Kulbc8xwplA由于上述公众号文章写的有些部分不够详细,比如repnet的transformer是什么,这里写一个自己读repnet和transformer论文的个人笔记repnet论文:http://openaccess.thecvf.com/content_CVPR_2020/papers/Dwibedi_Counting_Out_Time_Class_Agnostic_Video_Repetition_Coun

2020-07-02 16:16:22 643 1

原创 cnpy: c++中读取npy文件数组

https://github.com/rogersce/cnpygit clone https://github.com/rogersce/cnpy.git然后使用cmake-gui+visual studio生成cnpy的dll和lib;在打开sln文件生成项目时会出现如下错误,不用管它,lib和dll文件已经生成,拿到自己的项目中用就是了。(我这统一使用vs2017 x64 Release)然后新建个c++控制台工程,include cnpy头文件目录,include含有cnpy生成lib的目录

2020-06-24 19:15:53 3524 1

原创 ImportError: DLL load failed: 找不到指定的模块。

解决:pip uninstall opencv-pythonpip install -i https://pypi.tuna.tsinghua.edu.cn/simple opencv-python

2020-06-24 18:30:14 202

原创 opencv编译笔记(opencv 4.1.0 编译失败缺少opencv_world410d.lib)

问题:https://blog.csdn.net/ezhchai/article/details/80557936https://zhuanlan.zhihu.com/p/62416504按照以上网址使用cmake-gui和visual studio编译在visual studio出现编译失败缺少opencv_world410d.lib目标是为了得到x64位的opencv的opencv_world410.lib和opencv_world410.dll解决:通过https://github.com

2020-06-11 19:25:59 3081

原创 MNN Resize error for ConvertTensor,The input is not ready,Can’t run session because not resized

背景:使用vs2017编写加载mnn模型并推理输入图片的程序,发生如下错误The 321's input is not readyResize error for 321, code=3Resize error for ConvertTensor3, code=3Can't run session because not resized由于一开始在linux下生成的项目可执行文件也报了这个错误输出,其他推理的输出也是正常的;根据https://github.com/alibaba/MNN/is

2020-06-05 17:41:17 2594 7

原创 MNN windows环境编译 c++.exe: error: /wd4267: No such file or directory

按照https://www.yuque.com/mnn/cn/build_windows编译windows下的MNNcd /path/to/MNNpowershell ./schema/generate.ps1mkdir buildcd buildcmake -G "Ninja" -DCMAKE_BUILD_TYPE=Release ..ninja在windows10上出现C:\MinGW\bin\c++.exe -DBUILDING_MNN_DLL -DMNN_SUPPORT_TFLI

2020-06-03 10:46:57 1573 1

原创 git clone速度太慢解决方案

转载:https://blog.csdn.net/hzwwpgmwy/article/details/79043251适用各种操作系统,本次测试于ubuntu,下载速度从二十几k提高到二百多k1、查找域名对应的ip地址,并修改hosts文件nslookup github.global.ssl.fastly.Netnslookup github.com 将下列内容加入 /etc/hosts文件中151.101.76.249 http://global-ssl.fastly.net192.30.2

2020-05-12 18:33:59 829 1

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除