
Useful_tools&skills
独孤的大山猫
艰苦奋斗
展开
-
如何给检测算法加入跟踪
问题背景:给任何有检测框输出的检测算法加上跟踪,比如yolov3加上sort,然后遇到一个细节没注意,坑了自己一把,记录一下 out_boxes, out_scores, out_classes = self.sess.run( [self.boxes, self.scores, self.classes], feed_dict={ self.yolo_model.input: image_data,.原创 2020-11-07 12:26:59 · 862 阅读 · 0 评论 -
TypeError: function takes exactly 1 argument (3 given)
label = '{} {:.2f}'.format(predicted_class, score) image = image.convert('RGB') #*************************************** draw = ImageDraw.Draw(image)#*************************************** labe...原创 2020-09-12 23:15:40 · 1167 阅读 · 0 评论 -
No metadata found in d:\installfolder\anaconda3\envs\pytorch_gpu\lib\site-packages
解决办法:直接进入到site-packages对应的依赖包目录,然后删掉整个文件夹,重新 pip install即可原创 2020-09-10 01:09:59 · 3371 阅读 · 0 评论 -
tensorflow.python._pywrap_tensorflow_internal
问题背景: 我没有装完整版的cuda和cdunn,用的conda install装的cudatoolkit和cudnn,然后运行代码提示tensorflow.python._pywrap_tensorflow_internal解决办法:1.添加如下箭头处的路径到环境变量2.在python代码中添加搜索路径...原创 2020-09-08 00:17:37 · 1475 阅读 · 2 评论 -
Could not find ‘cudart64_90.dll.TensorFlow requires that this DLL be installed in a directory
问题背景:没有装nvidia完整版的cuda和cudnn,是用的是anaconda装的cudatoolkit 和 cudnn,然后运行导入tensorflow1.8版本的时候提示:也就是找不到cudart64_90.dll这个文件的路径解决办法:将下图的2个文件拷贝到system32文件夹中需要文件留言区留一下邮箱即可,看到都会发送~...原创 2020-09-06 17:19:05 · 1030 阅读 · 14 评论 -
python添加环境变量
sys.path.append('') # 添加到python的搜索路径类似于linux的export原创 2020-08-24 05:48:40 · 187 阅读 · 0 评论 -
action = “store_true
我们在python脚本中经常看到 action = "store_true,如下图:parser.add_argument( '--image', default=False, action="store_true", help='Image detection mode, will ignore all positional arguments')如果运行代码时加了--image ,那么 image为true如果没加 --image,那么image为False...原创 2020-08-19 00:18:10 · 27013 阅读 · 0 评论 -
2080ti装cuda9.0提示Blas SGEMM launch failed
出现的问题:有问题的环境:cuda = 9.0cudnn = 7.6.5RTX2080-Ti解决办法:换成cuda10.0(不是10.1,10.2)和cudnn7.6.5即可,2080ti和cuda9兼容性不太好(如果不升级cuda,安装cuda补丁也能解决)原创 2020-08-08 08:37:39 · 398 阅读 · 0 评论 -
module ‘cv2.cv2‘ has no attribute ‘face
错误提示:解决办法:pip install opencv-contrib-python问题消失:原创 2020-08-05 16:14:49 · 416 阅读 · 0 评论 -
OutOfRangeError (see above for traceback): End of sequence
问题背景:用mobilenetv2提取某张图像的特征,结果提示:原始代码:train_data = tf.data.Dataset.from_tensor_slices((X_in))train_data = train_data.map(mobi_parse_fun)train_data = train_data.batch(1) # batch算一个维度解决办法:train_data = tf.data.Dataset.from_tensor_slices((X..原创 2020-08-03 13:28:36 · 964 阅读 · 0 评论 -
解决Attempting to deserialize object on a CUDA device but torch.cuda.is_available() is False.问题
问题背景:解决办法:修改前torch.load(’./checkpoint.pth.tar’)修改后torch.load(’./checkpoint.pth.tar’,map_location=“cpu”)原创 2020-07-26 16:18:41 · 5697 阅读 · 0 评论 -
‘JpegImageFile‘ object is not subscriptable
问题截图:解决办法:# 更改keras版本pip install keras==2.1.4 -i https://pypi.tuna.tsinghua.edu.cn/simple/原创 2020-07-24 16:20:13 · 5086 阅读 · 0 评论 -
解决 invalid index of a 0-dim tensor. Use tensor.item() to convert a 0-dim tensor to a Python问题
错误截图:解决办法:报错原因分析:train_loss += loss.data[0] 是pytorch0.3.1版本代码在0.4-0.5版本的pytorch会出现警告,不会报错但是0.5版本以上的pytorch就会报错总的来说是版本更新问题.将原语句:train_loss+=loss.data[0]修改为:train_loss+=loss.item()...原创 2020-07-23 17:44:38 · 347 阅读 · 0 评论 -
pycharm终端和cmd终端中使用tab补全代码
问题背景:在pycharm IDE中可以使用tab键补全代码,terminal中不行!如下图所示,输入imp,然后按tab不能出来import:解决办法:pip install pyreadline -i https://pypi.tuna.tsinghua.edu.cn/simple/能自动补全的截图如下:...原创 2020-07-21 14:40:38 · 1872 阅读 · 0 评论 -
tensorboard通过logdir来可视化
做个可视化笔记: 注意使用的是localhost原创 2020-07-20 18:37:17 · 527 阅读 · 0 评论 -
libkmod:ERROR ignoring bad line starting with ‘b‘
问题如下图:可能的解决办法:sudo apt-get --reinstall -o Dpkg::Options::="--force-confask" install kmodsudo update-initramfs -u -v原创 2020-07-16 20:30:00 · 2188 阅读 · 1 评论 -
seq = iaa.Sequential()
问题背景:1月份写了一个数据增广软件,好久了,然后有买家问我iaa.Sequential()模块里面的augmenter是随机选择一个增强还是都选,还是选1到n个?# 产生一个处理图片的Sequential,里面定义各种用于数据增强的方法seq = iaa.Sequential([ iaa.Flipud(0.5), # flip up and down (vertical) iaa.Fliplr(0.5), # flip left and right (horizontal)原创 2020-07-14 13:13:53 · 2320 阅读 · 1 评论 -
pycharm配置pyqt5提示VCRUNTIME140_1.dll
问题背景:pycharm配置qt的时候,弹出来如下截图所示的错误:供参考的解决办法:(我用如下方法解决的):降低pyqt和pyqt-tools的版本pip install pyqt5==5.13 -i https://pypi.tuna.tsinghua.edu.cn/simple/pip install pyqt5-tools==5.13.0.1.5 -i https://pypi.tuna.tsinghua.edu.cn/simple/然后集可以在pychar...原创 2020-07-07 14:31:04 · 1127 阅读 · 8 评论 -
Pycharm的缓存过大怎么解决
问题背景:随着项目越来越多,pycharm在默认在C盘下的缓存也越来越大了,接近占了40G。解决办法:打开pycharm的安装目录,找到idea.properties修改如下箭头处为自己空间比较大的磁盘路径然后重旧的目录拷贝到新的目录就行了:...原创 2020-07-05 08:50:30 · 4238 阅读 · 0 评论 -
AttributeError: Can t pickle local object TrainingData batchgenerator locals batch_producer
问题:AttributeError: Can't pickle local object 'TrainingData.__batch_generator.<locals>.batch_producer'解决办法:修改num -workers = 0原创 2020-06-27 13:40:10 · 576 阅读 · 0 评论 -
编写python代码判断两个矩形是否相交
def overlap(box1, box2): # 判断两个矩形是否相交 # 思路来源于:https://www.cnblogs.com/avril/archive/2013/04/01/2993875.html # 然后把思路写成了代码 minx1, miny1, maxx1, maxy1 = box1 minx2, miny2, maxx2, maxy2 = box2 minx = max(minx1, minx2) miny = max(mi.原创 2020-06-20 17:27:14 · 5015 阅读 · 2 评论 -
InternalError: cudaGetDevice() failed. Status: cudaGetErrorString symbol not found
问题截图:解决办法:conda install tensorflow-gpu=2.0conda install cudatoolkit=10.0 cdunn=7 很显然,cuda和cudnn会在你装gpu版本的tf的时候自动被安装,不用单独去装cuda和cudnn了如下图:然后在tf中测试gpu是否可用: import tensorflow as tf tf.test.is_gpu_available()...原创 2020-05-20 22:25:02 · 4061 阅读 · 0 评论 -
Ubuntu启动项丢失
问题背景:重装windows系统后,Ubuntu启动项丢失。注意:这里说的是重装windows,也就是windows和Ubuntu原来就在一台电脑上组成了双系统(windows和Ubuntu不在一个盘上),后来因为某种原因,你重装了windows,然后Ubuntu启动项丢了。解决办法:1、用ultraISO做一个Ubuntu启动盘2、将Ubuntu启动盘设为第一启动项,然后点击 try Ubuntu(使用Ubuntu),不要点Install3、打开终端:依次输入sudo.原创 2020-05-16 11:34:19 · 902 阅读 · 0 评论 -
Loaded runtime CuDNN library: 7605 (compatibility version 7600) but source was compiled with 7003
错误截图:解决办法:附: 如果装不上,请换个源conda config --add https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/conda config --add https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/conda config --add https://mirrors.tuna.tsinghua.edu.cn/anaconda/.原创 2020-05-16 11:18:50 · 2443 阅读 · 6 评论 -
pandas,csv笔记
问题背景: 甲方给的数据时csv格式数据格式如下:红框内才是用于关键数据,然后我并不需要上面其他的信息:第一:可以看到甲方提供给我的csv文件是没有header的,所以读取的时候要用下面的方式把header设置为None,然后每列实际上是有意义的,就需要自己定义columan_namecolumn_name=['date','rank','player_id','sc...原创 2020-04-12 16:58:17 · 132 阅读 · 0 评论 -
Found OpenCV Windows Pack but it has no binaries compatible with your configuration.
红框内为错误提示:解决办法:修改你相关项目的CMakeLists.txt问题解决:原创 2020-04-09 06:02:12 · 5406 阅读 · 11 评论 -
使用everything批量修改文件名
这个软件叫everything,是真的方便,安利一波,ctrl+a全选,然后F2重命名%1.%2的意思是前半部分保存到变量1,后缀名保存到变量2,然后点确定结果就出来了。如下图...原创 2020-03-22 16:22:11 · 10974 阅读 · 1 评论 -
'utf-8' codec can't decode byte 0xce in position 124: invalid continuation byte These are the bytes
问题背景描述:打包py文件为exe的时候报错 'utf-8' codec can't decode byte 0xce in position 124: invalid continuation byte These are the bytes解决办法:在terminal中输入 chcp 65001然后 重新pyinstaller即可...原创 2020-03-21 23:36:32 · 392 阅读 · 0 评论 -
yolov3特征可视化
需要代码或者帮忙可视化的留一下邮箱,直接把配置好的代码发给你~原创 2020-03-18 10:02:47 · 3971 阅读 · 76 评论 -
An unexpected error has occurred. Conda has prepared the above report
conda创建虚拟环境的时候报错:An unexpected error has occurred. Conda has prepared the above report.If submitted, this report will be used by core maintainers to improve future releases of conda.Would you lik...原创 2020-03-03 18:38:47 · 21403 阅读 · 4 评论 -
Opencv的DNN模块如何用GPU加速
参考:https://www.pyimagesearch.com/2020/02/03/how-to-use-opencvs-dnn-module-with-nvidia-gpus-cuda-and-cudnn/十分给力,建议细看原创 2020-02-10 18:27:04 · 5076 阅读 · 1 评论 -
error mounting /dev/sda5
问题背景: 在Ubuntu下打不开Windows的磁盘解决办法:两行代码原创 2020-01-23 18:53:25 · 344 阅读 · 0 评论 -
在处理时有错误发生: sogoupinyin
sudo dpkg -i sogoupinyin_2.3.1.0112_amd64.deb提示如下:解决办法:(需要安装相关依赖)sudo add-apt-repository ppa:fcitx-team/nightlyapt-get updatesudo apt-get upgradesudo apt install libopencc1 fcitx-libs...原创 2020-01-21 14:01:18 · 10697 阅读 · 1 评论 -
如何解决 RecursionError: maximum recursion depth exceeded
有时候用pyinstaller 打包的时候会遇到:RecursionError: maximum recursion depth exceeded 这个递归错误,大概率是自己调用自己太多次导致的。解决办法:pyinstaller 之后会生成一个和xxx.py文件对一个的 xxx.spec 文件,如下图打开xxx.spec文件,在行首导入sys包,然后设置一...原创 2020-01-07 16:35:39 · 32569 阅读 · 1 评论 -
Pyinstaller打包imgaug模块
国内搜了一圈,没一个解答。自己一步步debug了一下,记录一下分析问题的过程事情起因: 给组里编写一个一键数据增广的GUI,可以产生增广后的图片,也可以产生对应的xml标记文件我只想单纯的测试一下import imgaug然后用 pyinstaller 打包看看什么情况,然后报了这个错误提示是'NoneType' object has no attrib...原创 2020-01-06 11:17:36 · 394 阅读 · 1 评论 -
unable to find Qt5Core.dll on PATH
背景: 用pyinstaller 打包python程序后,换了一台电脑测了一下,提示 unable to find Qt5Core.dll on PATH 错误解决办法: 加个PyQt5\\Qt\\bin 的路径解决了,我是这样成功的,供大家参考...原创 2019-11-13 18:53:23 · 465 阅读 · 0 评论 -
打包python程序成exe提示 ‘enum’ has no attribute 'IntFlag'
错误描述: 方便下次直接在windows上用,在打包python程序成exe的时候提示了这个错误解决办法:然后打包就不报错,并成功执行打包后的exe文件:...原创 2019-11-13 15:31:59 · 175 阅读 · 0 评论 -
windows下使用labelImg提示ImportError: No module named 'PyQt4'
解决办法: 找到用户目录下的.labelImgSettings.pkl,删除即可原因: 这个是有人之前运行过了,也就是执行过了,里面是别人之前的配置信息,删除后就行了。...原创 2019-11-13 14:44:50 · 1632 阅读 · 1 评论 -
Pycharm无法编辑问题
今天不知道点了鼠标误点了啥,Pycharm编辑区一编辑就出现下面全蓝,或者无法编辑的问题,要按几次键盘才能输入,额....解决办法:1、找到菜单栏的Tools2、取消VimEmulator这个看字面意思就知道了,是vim 模拟器,意思就是勾选了这个就进入了vim编辑模式,和ubuntu下面类似,编辑的时候需要按字母 i(表示insert)才能输...原创 2019-03-19 21:51:54 · 5239 阅读 · 0 评论 -
pycharm提示softmax() got an unexpected keyword argument 'axis'错误
今天帮师弟跑py程序,用的keras,我的环境是pycharm加anaconda(pycharm可以通过指定路径找到anaconda的配的环境,然后pycharm就不用在interpreter里面重新install了,很方便)错误如下:原因:interpreter里面显示我的keras是2.2.4 , tensorflow是1.2.1我们知道keras是以tenso...原创 2019-03-20 19:54:38 · 1435 阅读 · 0 评论