caffe
CDL_03
这个作者很懒,什么都没留下…
展开
-
caffe:BN层转batchnorm+scale修改prototxt
#coding=UTF-8import syssys.path.insert(0,'/home/cdli/ECO2/caffe_3d/python')import copyfrom caffe.proto import caffe_pb2from google.protobuf import text_formatimport googledef create_layer(base...原创 2020-04-07 10:53:02 · 309 阅读 · 0 评论 -
caffe:生成、修改prototxt及caffemodel解析完整版
1.读取prototxtfrom caffe.proto import caffe_pb2from google.protobuf import text_formatnet = caffe_pb2.NetParameter()solver = caffe_pb2.SolverParameter()f1=open('deploy.prototxt')f2=open('solver.pr...原创 2020-03-11 16:09:22 · 5174 阅读 · 2 评论 -
caffe:libjpeg.so.9: cannot open shared object file: No such file or directory
libjpeg.so.9是一个软连接,它指向libjpeg.so.9.2.0这是一个opencv需要的编解码库。这种库的默认搜索路径是/lib/usr/lib/usr/local/lib要在根目录添加这种so库的搜索路径的话,是在/etc/ld.so.conf/etc/ld.so.conf:include 路径需要在个人目录添加这种so库的搜索路径的话,~/.bashrc...原创 2020-03-11 13:59:57 · 1800 阅读 · 0 评论 -
解析caffe prototxt(2):合并卷积层与BN层
修改prototxt一、deploy1='../deploy-pool.prototxt'model1='../snapshots/pool_iter_5000.caffemodel'f=open(deploy1,'r')model = caffe.proto.caffe_pb2.NetParameter()##model类型:<class 'caffe_pb2.NetParam...原创 2019-12-25 17:05:11 · 854 阅读 · 0 评论 -
caffe加入LSTM_layer的方法
src/caffe/layers/lstm.cpp#include <vector>#include "caffe/blob.hpp"#include "caffe/common.hpp"#include "caffe/filler.hpp"#include "caffe/layer.hpp"#include "caffe/util/math_functions.hpp"...原创 2019-11-12 19:21:02 · 302 阅读 · 0 评论 -
解析caffemodel:记录conv、BN、batchnorm和scale
import caffeimport numpy as npdeploy='deploy.prototxt'model='ECO_full_kinetics.caffemodel'net = caffe.Net(deploy,model,caffe.TEST)all_layer_name=net.params.keys() #所有参数的层的名字all_blob_name=net.b...原创 2019-11-06 17:58:05 · 773 阅读 · 0 评论 -
caffe:Check failed: 0 == bottom[0]->count() % explicit_count (0 vs. 101) bottom count (1010) must be
Check failed: 0 == bottom[0]->count() % explicit_count (0 vs. 101) bottom count (1010) must be divisible by the product of the specified dimensions (303)原因就是测试的时候应当输入deploy的路径,却写成了train_val的路径...原创 2019-07-25 10:12:05 · 531 阅读 · 0 评论 -
caffe.io.load_image读图失败
caffe图片批量测试时,其中一个图片无法读图,报错如下:Traceback (most recent call last):File “text.py”, line 44, in im = caffe.io.load_image(’/home/wxp/cdli/1/吉利/吉利-帝豪-20142015(三厢)/001543286342692.jpg’)File “/home/wxp/caf...原创 2019-05-23 09:37:28 · 557 阅读 · 0 评论 -
caffe生成均值文件、protobinary转npy
current_path=`cd $(dirname $0) ; pwd`EXAMPLE=$current_path #lmdb所在路径DATA=$current_path #要放均值文件的路径TOOLS=/home/cdli/caffe-ssd/build/tools$TOOLS/compute_image_mean $EXAMPLE/train_lmdb $DATA/mean.bi...原创 2019-04-11 14:38:28 · 203 阅读 · 0 评论 -
caffe生成lmdb文件
从txt标签文件生成lmdb(其实是得到一个文件夹,里面有2个文件)current_path=`cd $(dirname $0) ; pwd ` #获取脚本所在路径EXAMPLE=$current_path #lmdb要放的路径DATA=$current_path #txt文件所在路径TOOLS=/home/cdli/caffe-ssd/build/toolsTRAIN_DATA_R...原创 2019-04-11 14:33:36 · 653 阅读 · 0 评论 -
libcudart.so.9.2: cannot open shared object file: No such file or directory
原本配置好的caffe,已经训练过好几个模型了,一礼拜没动在回去执行训练时,就显示libcudart.so.9.2: cannot open shared object file: No such file or directory。后面发现是python在import caffe时报错,原因在于CUDA路径不对。但是又可以正常执行test的python脚本,脚本开头有import caffe...原创 2019-04-10 18:15:04 · 3637 阅读 · 2 评论 -
python遍历文件夹生成标签数据txt文件
# coding=UTF-8import osimport syspath="/home/cdli/Original_10.18"filenames=os.listdir(path) #读取path内所有文件名返回列表i=0with open("train_color.txt","w") as f: for filename in filenames: ...原创 2019-03-27 10:10:32 · 1427 阅读 · 0 评论 -
caffe从log里画loss3或者loss3_top-1的图
import matplotlib.pyplot as pltimport numpy as npimport reloss = [] iteration = 0 #存放迭代次数with open("log.txt", 'r') as f: for line in f: if "Test net output #6" in line: #loss3 loss.appen...原创 2019-03-25 15:06:37 · 254 阅读 · 0 评论 -
配置caffe遇到的一系列问题
第一个BUGmake all,make test,make runtest,make pycaffe均不报错。对cifar10进行训练成功,但是在进行测试的时候classify.py报错:Traceback (most recent call last):File “”, line 1, in File “/home/cdli/caffe-ssd/python/caffe/init.py”...原创 2019-03-19 16:44:24 · 314 阅读 · 0 评论