自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(39)
  • 资源 (1)
  • 收藏
  • 关注

原创 utf-8 不能解码0xcb in position 4947

运行程序时报错:Traceback (most recent call last): File "train_resnet50.py", line 3, in <module> from nets.resnet import resnet_v2_50 File "/home/work/gtt/datasets/nets/resnet.py", line 5, in <module> import tensorflow.contrib.slim as slim

2020-06-29 16:26:30 338

转载 进入正在运行的容器

docker psdocker exec -it 98ac4a9e8de7 /bin/bashcd /home/work/....参考链接:https://blog.csdn.net/starzhou/article/details/106112586

2020-06-29 15:55:56 337

转载 活体检测

转载

2020-06-28 17:13:48 139

转载 slim.flatten()函数的用法

slim.flatten功能:将输入扁平化但保留batch_size,假设第一维是batch size具体的:slim.flatten(inputs,outputs_collections=None,scope=None)Args:inputs: a tensor of size [batch_size, …].outputs_collections: collection to add the outputs.scope: Optional scope for name_scope.举个栗子

2020-06-28 14:44:46 1086

原创 tf.image.decode_and_crop_jpeg的用法

tf.io.decode_and_crop_jpeg(contents, crop_window, channels=0, ratio=1, fancy_upscaling=True,try_recover_truncated=False, acceptable_fraction=1, dct_method=’’, name=None)功能解码和裁剪一个jpeg编码的图像到一个uint8张量;参数(1)channels表示解码图像所需的彩色通道数:Accepted values are:0

2020-06-24 20:40:28 431

转载 tensorflow中将张量和数组相互转换

import tensorflow as tf sess=tf.Session()sess.run(tf.global_variables_initializer())#转化为numpy数组img_numpy=img.eval(session=sess)print("out2=",type(img_numpy))#转化为tensorimg_tensor= tf.convert_to_tensor(img_numpy)print("out2=",type(img_tensor))...

2020-06-24 15:59:54 2270

原创 裁剪图片为指定的大小

在训练口罩模型时直接使用鼻子以上的图片进行训练,对数据进行裁剪import cv2import tensorflow as tfimport matplotlib.pyplot as pltimport osos.chdir(r'E:\centernet_data\COCO_dataset\val2017')bear = cv2.imread('000000000285.jpg')# 根据小图像的大小,在大图像上创建感兴趣区域roi(放置位置任意取)height, width = bea

2020-06-24 15:43:36 534

原创 Required argument mat pos 2 not found错误解决方法

cv2显示图片时报错:Traceback (most recent call last): File "E:/ZCenterFace/picture_crop.py", line 26, in <module> cv2.imshow(bear1)TypeError: Required argument 'mat' (pos 2) not found原因是cv2需要两个参数,修改为:cv2.imshow('img',bear1)即可。...

2020-06-24 15:37:20 1405

转载 TF.Slim的repeat和stack操作

一:常规做法在搭建网络时,TF-Slim 提供 repeat 和 stack,允许用户重复执行相同的 操作,方便网络构建,例如:net = ...net = slim.conv2d(net, 256, [3, 3], scope='conv3_1')net = slim.conv2d(net, 256, [3, 3], scope='conv3_2')net = slim.conv2d(net, 256, [3, 3], scope='conv3_3')net = slim.max_pool2d

2020-06-23 17:19:01 125

原创 io/opencv/modules/imgproc/src/imgwarp cpp

模型训练中opencv报错如下: flags=cv2.INTER_LINEAR)cv2.error: OpenCV(4.1.0) /io/opencv/modules/imgproc/src/imgwarp.cpp:1729: error: (-215:Assertion failed) dst.cols < SHRT_MAX && dst.rows < SHRT_MAX && src.cols < SHRT_MAX && src.

2020-06-23 13:58:07 1679 1

原创 np.maximum()

a1 = [3,5,2,1,6]a2 = [7,1,2,4,2]np.maximum(a1,a2)Out[21]: array([7, 5, 2, 4, 6])np.maximum()接收两个参数进行逐位比较,谁大返回谁。

2020-06-22 19:41:44 1325

原创 win10 AssertionError: Torch not compiled with CUDA enabled

win10系统下CUDA已安装,运行训练程序时报错:File "D:\anaconda\lib\site-packages\torch\backends\cudnn\__init__.py", line 78, in version if _libcudnn() is None: File "D:\anaconda\lib\site-packages\torch\backends\cudnn\__init__.py", line 54, in _libcudnn compile_ver

2020-06-20 17:33:27 25461 8

转载 error: Unable to find vcvarsall.bat与D:\\vs2015\\VC\\BIN\\x86_amd64\\cl.exe failed

我在执行make命令时出错error: Unable to find vcvarsall.bat安装了vs2015之后就没有这个问题了,换了个bug… makepython setup.py build_ext --inplacerunning build_extbuilding 'nms' extensioncreating buildcreating build\temp.win-amd64-3.6creating build\temp.win-amd64-3.6\ReleaseD:\

2020-06-20 11:54:09 560

原创 Windows10下bash: make: command not found

在服务器上测试模型的速度,gpu都快被别人沾满了,测得结果可能不太准确,在本地win10系统配置环境运行的时候报错:$ makebash: make: command not found解决方法:1.安装MinGW2.下载make-4.2.1-without-guile-w32-bin.zip,下载网址 将内容复制到你安装的git目录下 D:Git \ mingw64 \合并文件夹,但不要覆盖/替换任何现有文件。然后就OK了,有的可能不太好下载,多刷新。。问题解决。参考链接:https

2020-06-19 15:48:56 8995 2

转载 模型微调

参考

2020-06-18 11:26:53 84

转载 weight decay,normalization和momentum

参考链接

2020-06-18 11:05:59 109

原创 bash: vi: command not found

新进入一个docker的时候,没有vi命令,这种情况已经遇见好几次了,记录一下。vi train_mv2.pybash: vi: command not found按照网上的方法,运行apt-get install vim:apt-get install vimReading package lists... DoneBuilding dependency treeReading state information... DoneThe following additional pack

2020-06-16 16:23:12 2906

原创 cuDNN launch failure

报错:InternalError (see above for traceback): cuDNN launch failure : input shape ([64,112,112,1]) [[Node: depth_1/BatchNorm/FusedBatchNorm = FusedBatchNorm[T=DT_FLOAT, data_format="NHWC", epsilon=2e-05, is_training=true, _device="/job:localhost/rep

2020-06-13 16:25:42 1781 3

转载 tf.expand_dims()

链接: link.

2020-06-13 16:18:22 168

转载 tf.ConfigProto (allow_soft_placement=True)

tf.ConfigProto一般用在创建session的时候用来对session进行参数配置。with tf.Session(config = tf.ConfigProto(…)…)原文链接.

2020-06-13 15:50:55 793

原创 TypeError: batch() got an unexpected keyword argument drop_remainder

报错:Traceback (most recent call last): File "train_mv2.py", line 652, in <module> train = Trainer() File "train_mv2.py", line 276, in train_net if mode == 0: File "train_mv2.py", line 296, in train_orbbec train_op = self.train_op(lo

2020-06-13 15:47:21 1225

原创 导入keras出错

运行程序的时候报错:get_graph = tf_keras_backend.get_graphAttributeError: module 'tensorflow.python.keras.backend' has no attribute 'get_graph'这是因为keras安装的有问题,运行import keras应该也是有问题的,这是因为安装的keras 和tensorflow的版本不兼容,我的tensorflow是gpu 1.12版本,卸载keras ,重装一个keras 2.2

2020-06-11 19:16:03 955

原创 win10安装pycocotools

win10安装pycocotools 出现如下错误:$ pip install pycocotoolsCollecting pycocotools Using cached pycocotools-2.0.0.tar.gz (1.5 MB)Building wheels for collected packages: pycocotools Building wheel for pycocotools (setup.py): started Building wheel for pycoc

2020-06-11 15:01:31 960

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

解决办法卸载torchvision,pip uninstall torchvision使用pip install torchvision==0.2.2.post3安装这个版本的torchvision,可以成功引入

2020-06-11 14:10:37 1083

转载 PIL中的Image和numpy中的数组array相互转换

PIL image转换成arrayimg = np.asarray(image)需要注意的是,如果出现read-only错误,并不是转换的错误,一般是你读取的图片的时候,默认选择的是"r","rb"模式有关。修正的办法: 手动修改图片的读取状态img.flags.writeable = True # 将数组改为读写模式array转换成imageImage.fromarray(np.uint8(img))...

2020-06-10 21:41:42 475

转载 TFRecoed文件的制作及读取

TFRecord是什么TFRecord格式是一种将图像数据和标签放在一起的二进制文件,能更好的利用内存,在tensorflow中快速的复制,移动,读取,存储 等等。TFRecords文件包含了tf.train.Example 协议内存块。可以写一段代码获取数据, 将数据填入到Example协议内存块(protocol buffer),再将协议内存块序列化为一个字符串, 并且通过tf.python_io.TFRecordWriter 写入到TFRecords文件。从TFRecords文件中读取数据, 可

2020-06-10 21:39:32 433

转载 如何进行人脸校正

https://www.jianshu.com/p/c781e9b81af0

2020-06-10 20:07:23 881

转载 tf.cast()数据类型转换

tf.cast()函数的作用是进行数据类型转换,比如读入的图片如果是int8类型的,一般在要在训练前把图像的数据格式转换为float32。cast定义:cast(x, dtype, name=None)第一个参数 x: 待转换的数据(张量)第二个参数 dtype: 目标数据类型第三个参数 name: 可选参数,定义操作的名称例如将 int32转换为float32:import tensorflow as tf t1 = tf.Variable([1,2,3,4,5])t2 = tf

2020-06-10 18:56:35 210

原创 不管怎么指定pytorch都使用gpu0进行训练解决方法

这个问题困惑了我好久,不管怎么指定,程序中用的os.environ['CUDA_VISIBLE_DEVICES'] = '1,2'并不管用最后都显示RuntimeError: CUDA out of memory. Tried to allocate 158.00 MiB (GPU 0; 11.17 GiB total capacity; 556.72 MiB already allocated; 26.06 MiB free; 17.28 MiB cached)真的是很泪奔了,最后查到,pyto

2020-06-09 19:41:40 4790 7

原创 CMake Error at CMakeLists.txt:29 (cmake_minimum_required): CMake 3.5.1 or higher is required. You ar

完整的错误信息:CMake Error at CMakeLists.txt:29 (cmake_minimum_required): CMake 3.5.1 or higher is required. You are running version 3.3.2cmake需要更高的版本,参考:https://blog.csdn.net/qq_23958451/article/details/100526699卸载低的版本安装更高版本的cmake不知道为什么,我在官网上下载的最新版cmake3.17,

2020-06-08 19:13:44 4357

原创 The NVIDIA driver on your system is too old (found version 9020).解决方法

原本的环境是cuda9.0,pytorch 1.1.0版本的,在进行centerface训练模型的过程中,遇到以下报错:AssertionError:The NVIDIA driver on your system is too old (found version 9020).Please update your GPU driver by downloading and installing a newversion from the URL: http://www.nvidia.com/Dow

2020-06-08 19:11:16 3099

原创 centerface训练WiderFace数据集错误总结

调试Centerface程序时,报错如下错误1(torch110) root@fb488cec2ed5:/home/work/gaotong/xinying/ZCenterFace/src# python main.pyTraceback (most recent call last):File “main.py”, line 14, in from models.model import create_model, load_model, save_modelFile “/home/work/

2020-06-08 19:07:42 1174

原创 ValueError: too many values to unpack (expected 2)

ValueError: too many values to unpack (expected 2)这个问题的出现是你函数中的返回值与真实的函数返回值个数不一致,仔细检查程序,如果返回值不用的话,也要写上,类似于:_,_,self.train_input.orbbec_depth, labels = self.sess.run(data_train_batch)...

2020-06-08 16:07:07 607

转载 FixedLenFeature

背景在使用dataset进行样本解析之前,我们需要先定义一个解析字典,告诉dataset如何去解析每个样本,这个字典就是用来指定对于每条输入样本的每一列应该用什么的feature去解析,dataset默认提供了FixedLenFeature,VarLenFeature,FixedLenSequenceFeature等。顾名思义,FixedLenFeature用于处理定长的特征,VarLenFeature用于处理变长的特征,FixedLenSequenceFeature用于处理定长的序特征。案例feat

2020-06-08 14:58:00 1157

转载 tf.io.read_file()

https://www.malaoshi.top/show_1EF4VxYA51W2.html

2020-06-08 14:08:35 2416

原创 namedtuple

最近在看程序的时候,发现了namedtuple,不太熟悉,记录一下。Conv = namedtuple('Conv', ['kernel', 'stride', 'depth', 'ratio'])DepthwiseConv = namedtuple('DepthwiseConv', ['kernel', 'stride', 'depth', 'ratio'])InvResBlock = namedtuple('InvResBlock', ['kernel', 'stride', 'depth', '

2020-06-06 19:47:25 231

原创 ImportError: libSM.so.6: cannot open shared object file: No such file or dir

出现错误:ImportError: libSM.so.6: cannot open shared object file: No such file or dir解决方法:apt-get install libsm6如果你出现了上面的错误,那你很大概率也会遇到下面的问题,类似的, ImportError: libXrender.so.1: cannot open shared object file: No such file or directory运行apt-get install li

2020-06-06 19:38:09 8159 8

原创 apt-get update 一直 0% working 失败解决方案

解决方法:方法一第一步:root@validator-dev-group-c2v4:~# cd /usr/lib/apt/methods第二步: root@validator-dev-group-c2v4:/usr/lib/apt/methods# ln -s http https方法二删掉一个文件后,再运行apt-get update命令:rm -r /etc/apt/sources.list.d参考:https://blog.csdn.net/c8241998/article/detail

2020-06-06 17:09:46 1443

转载 退出容器,但是不停止当前容器

进入docker 容器后,如果通过exit 退出,退出后容器会自动停止,如果需要只退出容器但是不停止容器需要结合快捷键Ctrl+p+q转载:https://www.cnblogs.com/aldshengdeng/articles/12802991.html

2020-06-06 16:36:16 708

Python与算法基础知识点总结.pdf

适合想要自学python及算法的同学,里面是我自己找工作时自学python写的笔记,120页pdf文档,目前从事深度学习CV方面,文档里有部分数据结构内容、python语法偏多,还有部分算法知识点总结,适合想找机器学习、深度学习岗位的小伙伴~ 超多干货哦,哈哈哈~~ 有不懂的地方可以加微信或者邮件一起交流~~

2021-03-23

空空如也

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

TA关注的人

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