自定义博客皮肤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)
  • 收藏
  • 关注

原创 ubuntu16.04更新安装protoc

目的是为了使用tensorflow object detection API。但是ubuntu16.04默认安装的是protoc 2.6.1 不满足需求。需要更新protoc版本到3.4.1

2020-01-18 14:09:45 2486

原创 Nvidia 视频处理框架----1. VideoProcessingFramework 介绍和安装

地址:https://github.com/NVIDIA/VideoProcessingFramework简介:VPF(VideoProcessingFramework) 是一个视频处理框架。利用c++ 库和python绑定能够提供视频处理任务的硬件加速。例如:编码,解码,转码,颜色空间和像素转换的GPU加速。安装:系统:ubuntu16.04环境准备:python 环境:...

2020-01-04 15:13:16 3913 10

原创 python任务调度之schedule 获取执行任务的返回值

背景:python利用schedule库执行定时任务。import scheduleimport timedef myjob(): print("I'm working...")schedule.every(10).minutes.do(myjob)while True: schedule.run_pending() time.sleep(1)但是我...

2019-12-31 15:24:54 4560 2

原创 processing annotations of CULane:fatal error: opencv2\highgui.hpp: No such file or directory

#项目地址:https://github.com/XingangPan/seg_label_generate#编译错误:fatal error: opencv2\highgui.hpp: No such file or directory#原因:因为opencv2和opencv3文件目录不同造成。#解决:1. 修改MakeFileOPENCV = -I/usr/local/in...

2019-11-25 15:12:28 1036 2

原创 Not JSON Serializable error tf2.0

背景:使用的模型需要转换成tflite,用tf.keras重写后,因为用到了tf.keras.activations operators 所以在model.save的时候会报错Not JSON Serializable error。应该是类型不支持,造成node json序列化失败。解决方法:1. 官方tf nightly build '2.0.0-dev20190802' 版本已经fi...

2019-10-29 10:37:21 418

原创 ffmpeg 开发记录一

项目背景:所要实现的功能类似于直播。整个直播流程要打通,从摄像头拉流,到解码拆帧,然后处理之后编码推流,最后展示。摄像头:海航威视 DS-IPC-B系列的摄像头。开发工具:pycharm,ffmpeg/gstreamer环境:mac,VLCrstp/rtmp server: node-rtsp-rtmp-server,gst-rtsp-server, rtsp-server,Eas...

2019-10-19 16:47:58 267

原创 pytorch 和 keras padding对比

一、pytorch 相关torch.nn.Conv2d(in_channels, out_channels, kernel_size, stride=1, padding=0, dilation=1, groups=1, bias=True, padding_mode='zeros')其中padding_mode 有两种。默认值是‘zeros’,另一个是‘circular’(这种模式貌似...

2019-09-29 17:35:03 2559

原创 python3处理带中文的文件

解决办法:​​​​​​​def bad_filename(filename): temp = filename.encode(sys.getfilesystemencoding(), errors='surrogateescape') return temp.decode('utf-8')for name in files: try: prin...

2019-09-24 17:15:14 439

原创 cv2.VideoCapture() always return false

背景:读取摄像头视频,cv2.VideoCapture() 总是返回false解决办法:要么自己编译opencv with ffmpeg,要么安装高版本的opencv>=3.4.1.15之前是通过pip安装的opencv 3.2版本,测试的时候cv2.VideoCapture() 总是返回false。网上资料也都是让自己安装ffmpeg并编译opencv,再把.so文件copy到相...

2019-08-14 18:26:33 1764

原创 DABNet: Depth-wise Asymmetric Bottleneck for Real-time Semantic Segmentation

论文地址:https://arxiv.org/pdf/1907.11357.pdf代码地址:https://github.com/Reagan1311/DABNet论文利用了depth-wise asymmetric convolution and dilated convolution 设计了DAB module(Depthwise Asymmetric Bottleneck),充分利用...

2019-07-30 15:17:11 1203 2

原创 Efficient Dense Modules of Asymmetric Convolution for Real-Time Semantic Segmentation

论文地址:https://arxiv.org/pdf/1809.06323.pdf作者:Shao-Yuan Lo1 Hsueh-Ming Hang1 Sheng-Wei Chan2 Jing-Jhih Lin2 1 National Chiao Tung University 2 Industrial Technology Research Institute sylo95.eecs02@g2...

2019-07-27 19:05:29 943

原创 学习过程中遇到的bug(持续更新)

错误:RuntimeError: CUDA error: unknown error解决方法:sudo rm -rf ~/.nv错误:RuntimeError: Failed to export an ONNX attribute, since it’s not constant, please try to make things (e.g., kernel size) s...

2019-07-26 18:55:36 5624 7

原创 RuntimeError: Failed to export an ONNX attribute, since it's not constant, please try to make things

这是一个Pytorch1.1版本pytorch模型转onnx的bug参考:https://blog.csdn.net/Cxiazaiyu/article/details/91129657解决方法:1.pip install -i https://pypi.tuna.tsinghua.edu.cn/simple torch==1.0.12.pip install -i https...

2019-07-26 13:00:38 2789 2

原创 Tensorboard could not bind to unsupported address family问题解决

背景:ubuntu 16.04下使用tensorboard报错Tensorboard could not bind to unsupported address family解决:tensorboard --logdir=/tmp/mnist/log/ --port 8023 --host 本机ip

2019-04-28 21:01:32 1959

原创 Expected object of scalar type Long but got scalar type Float

背景:训练模型的时候报错Expected object of scalar type Long but got scalar type Float解决:方法一:targets =torch.LongTensor(targets)方法二:targets = targets.to(self.device,dtype=torch.int64)...

2019-04-28 18:33:56 9444 1

原创 记录一次tensorflow cuda out of memory

背景:训练的时候cuda 报错out of memory解决:排查原因。基本out of memory就是显存不够了,batchsize 太大的原因。将batchsize改小了以后确实问题也解决了。但是让我疑问的是之前我跑程序的时候还没有任何问题。突然就out of memory.注:tensorflow 默认run的时候将显存全占。设置config就解决。config = tf...

2019-04-28 18:17:26 872

原创 apache2 如何禁止目录列举

背景:项目部署上线,由于所有文件都放在/static/对应的目录下,当直接访问/static/的时候会将所有的静态资源都列举出来,这是不被允许的。解决方法:修改apache配置禁用目录列举。<Directory> Options -Indexes</Directory>配置directory的时候加上以上值就ok。...

2019-04-26 16:34:08 892

原创 pytorch中计算准确率,召回率和F1值的方法

predict = output.argmax(dim = 1)confusion_matrix =torch.zeros(2,2)for t, p in zip(predict.view(-1), target.view(-1)): confusion_matrix[t.long(), p.long()] += 1a_p =(confusion_matrix.diag() / c...

2019-04-26 11:30:57 18668 2

原创 tensorflow中tf.train.string_input_producer()方法

背景:最近用tensorflow读取大量的数据,为了高效读取数据,采用tf.train.string_input_producer()方法问题:tf.train.string_input_producer()中可以指定epoch这个参数,但是用的时候发现好像没法获取一个epoch是什么时候结束官方文档:https://www.tensorflow.org/api_docs/python/t...

2019-04-23 14:04:25 6148

原创 TFRecords 拆分

背景:由于之前已经生成了训练数据的tfrecords,需要对已经生成的tfrecords根据类别去按比例拆分。或者将一个大的tfrecors拆分成几个小的tfrecords。参考:https://stackoverflow.com/questions/54519309/split-tfrecords-file-into-many-tfrecords-files?rq=11. 将大的tfre...

2019-04-22 17:41:16 1407

原创 TypeError: 'module' object is not callable

记录一下遇到的错误。在使用tqdm的时候,由于导包的问题导致了TypeError: 'module' object is not callable。如果是import tqdm使用tqdm的时候,就需要tdqm.tqdm()去调用。而如果是from tqdm import tqdm就可以直接用tqdm()去调用...

2019-04-19 16:33:57 10252 5

原创 python3 import包问题

背景:导入父级目录的兄弟目录下的文件解决:示例图:--src | | --A | --a.py --B | --b.py目的是为了能在a.py中导入b.py首选在A,B文件夹下创建__init__.py然后在a.py中加入:BASE = os.path.dirname(os.path...

2019-04-18 12:02:29 441

原创 numpy 使用记录之numpy newaxis和numpy.where() 用法

1.numpy.where() 的用法详解官方文档:https://docs.scipy.org/doc/numpy/reference/generated/numpy.where.htmlnp.where(condition,x,y)满足条件输出x,不满足条件输出y。np.where(condition)如果只有条件没有x,y.则相当于np.asarray(condit...

2019-04-12 19:59:43 313

原创 pytorch学习笔记之torch.max()

官方的api:https://pytorch.org/docs/0.3.1/tensors.html,https://pytorch.org/docs/0.3.1/torch.html#torch.max该方法的使用可以有两种方式去调用。方法一:将对象当作参数传入的方式a =torch.Tensor([[0,1,2],[3,4,5]])torch.max(a,0)方法二:直接...

2019-04-11 17:29:59 3763

原创 python 管理GPU资源

背景:解决模型运行时GPU资源占用量等各种数据的统计解决办法:利用python库py3nvml官方文档:https://py3nvml.readthedocs.io/en/latest/github:https://github.com/fbcotter/py3nvml安装方式:(我的python版本是python3.5)pip install nvidia-ml-py3...

2019-04-10 13:59:19 1270

原创 ubuntu16.04 jupyter notebook --generate-config报错UnicodeEncodeError

背景:环境采用的anocanda,装好了jupyter之后,执行jupyter notebook --generate-config报错问题:UnicodeEncodeError: 'ascii' codec can't encode characters in position 1279-1280解决: 由于之前从来没有在这一步遇到过编码的问题。后来locale查看系统编...

2019-04-09 17:09:42 2869

原创 解决pycharm无法导入PIL(pillow)

背景:本地pycharm链接远程linux服务器,远程linux服务器已经安装好了pillow库,但是本地安装库总是没法更新,导致报错can't import scipy.misc.imresize解决方法:尝试了File ->invalidate Caches/Restart 但是依然不起作用。Pycharm ->Preferences --> Project:**...

2019-04-08 15:03:43 11624

原创 datatables 使用笔记,包含(iCheck.js)

背景:最近在使用datatables的时候遇到了很多的问题。在此将自己遇到的问题做一下汇总。参考链接:英文:https://datatables.net/中文:http://datatables.club/1. 如果采用服务器端的分页,我想实现跨页选择多行该怎么办?官网例子链接:https://datatables.net/examples/server_side/select...

2019-04-04 11:14:43 436

原创 datatables 实现表格汉化,第一列添加复选框checkbox及相关操作实现

背景:项目需要做后台管理前端界面。数据展示用到datatables问题:需求是表格展示第一列添加checkbox复选框,因为datatables生成的table是没有复选框的。而且要实现批量选择,单击行选择等操作。参考资源:datatables中文,datatables英文,https://chinacheng.iteye.com/blog/2105036,https://stacko...

2019-03-15 18:27:57 3386

原创 ES6中this 指向的问题探索

问题背景:由于最近在看项目源码,本身个人非前端开发。看到代码中的this就会有些困惑this的指代是什么。参考链接:深入理解ES6箭头函数中的this                  ES6箭头函数的this指向                  JavaScript 的 this 原理实验过程:this的指代分为两种情况。普通的函数和箭头函数。1. 普通函数可以见得普通...

2019-02-27 12:32:34 3663 1

原创 centos7源码编译安装ffmpeg

centos7源码编译安装ffmpeg参考链接:https://www.jianshu.com/p/2b98e0f87720正常情况下按照上面的步骤是可以安装成功的。后来由于环境问题,上述安装过程会报错:error while loading shared libraries: libva.so.1就是一些依赖库的问题。后来参考:https://www.jianshu.co...

2019-02-13 13:56:19 1953

原创 centos7安装postgresql 9.6数据库,并和django交互

1. 部署环境系统:centos7数据库:postgresql 9.6后台web框架:django 2.0.32.安装步骤centos7安装posrgresql 9.6 参考链接但是会在执行以下命令的时候报错。sudo /usr/pgsql-9.6/bin/postgresql96-setup initdb原因是中文乱码造成的吧,将系统设置成支持utf-8就好了。解决中文乱码的...

2019-01-18 00:37:24 318

原创 django 报错:django.db.utils.OperationalError: no such table: main.auth_user__old

django报错:1. 报错环境描述django version:2.0.3python verison:3.6.62. 报错点执行 python manage.py createsuperuser 后输入密码完成后报错。File &quot;/home/luban/miniconda3/lib/python3.6/site-packages/django/db/backends/utils.p...

2019-01-18 00:13:45 3205

原创 supervisor 管理redis 和httpd 环境centos7

supervisor 管理redis 和httpd 环境centos7一. 问题背景二. 环境准备三. 配置文件修改一. 问题背景由于之前项目是在ubuntu16.04环境下开发,但是上线环境为centos,所以重新踩坑以下supervisor 管理redis 和httpd过程。二. 环境准备需要的环境包括:python环境,redis环境,httpd环境,supervisor环境py...

2019-01-17 16:41:30 552

原创 supervisor 管理apache2 服务 in ubuntu16.04

关于supervisor管理redis可以参考我写的这篇:https://blog.csdn.net/coding_zhang/article/details/86521205问题背景:由于项目以apache2作为server,项目依赖的service较多,一个一个管理不太方便。解决办法:通过supervisor来集中管理具体过程:1.安装步骤ubuntu16.04环境下:...

2019-01-17 15:00:49 847 2

原创 supervisor 管理redis 环境ubuntu16.04

参考链接:https://baiyongjie.com/?p=385问题背景:由于最近项目需要好多个服务,之前都是在服务器通过手动启动服务的方式,这样不利于各种服务的管理。解决方法:通过supervisor去统一进行管理具体过程:1.简易版的安装过程ubuntu16.04环境下:sudo apt-get install supervisorsudo apt-get in...

2019-01-17 12:46:28 241

原创 pycharm2018.3.3专业版激活,到2100年

时间:2019.1.15日参考链接:https://zhuanlan.zhihu.com/p/53341549,https://blog.csdn.net/cspecialy/article/details/84933545安装环境:macpycharm下载地址:https://www.jetbrains.com/pycharm/破解方式:破解补丁激活先上图:补丁下载链...

2019-01-15 17:04:36 3101

原创 贝叶斯算法

贝叶斯算法贝叶斯算法需要解决的问题:1. 正向概率 假设袋子中n白球,m黑球,摸到黑球概率多大2. 逆向概率 事先不知道袋子中黑白球个数,从袋子中摸出一个或几个球,观察这些取出球的颜色,以此来推断袋中白黑球的比例。为什么需要贝叶斯现实世界本身就是不确定的,假设黑白球数量无限大,人类观察能力有限,我们不可能完全观察出整个黑白球的数量。只能随机抽,观察抽出来的球的颜色,可以多抽几次,

2017-10-14 13:05:50 190

原创 win10 64位+anaconda+python 2.7.12 安装xgboost

xgboost安装过程第一次写博客,不足之处还请见谅。由于最近要使用xgboost,所以决定试着安装一下。本以为是一个很简单的事情,出我意料之外遇到了不小的麻烦。(在此也是建议能有条件使用linux,就不要使用windows.太多坑!)http://xgboost.readthedocs.io/en/latest/build.html这是官方的安装教程一些预备安装可以参考 http://blog.

2017-05-18 22:12:54 990

空空如也

空空如也

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

TA关注的人

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