摘要: net.bn = caffe.layers.BatchNorm( net.conv1, batch_norm_param=dict( moving_average_fraction=0.90, #滑动平均的衰减系数,默认为0.999 use_global_stats=False, #如果为真,则使用保存的均值和方差,否则采用滑动... 阅读全文
posted @ 2018-11-06 10:51 HOU_JUN 阅读(797) 评论(0) 推荐(0) 编辑
摘要: https://www.jianshu.com/p/1a420445deea n.conv1=L.Convolution(n.data,kernel_size=7, stride=2,num_output=64, pad=3,weight_filler=dict(type='msra'),bias_ 阅读全文
posted @ 2018-11-06 10:21 HOU_JUN 阅读(713) 评论(0) 推荐(0) 编辑
摘要: 对于convolution: output = (input + 2 * p - k) / s + 1; 对于deconvolution: output = (input - 1) * s + k - 2 * p; 阅读全文
posted @ 2018-11-06 09:36 HOU_JUN 阅读(1726) 评论(0) 推荐(0) 编辑
摘要: 一、显示各层 二、自定义函数:参数/卷积结果可视化 三、训练过程Loss&Accuracy可视化 阅读全文
posted @ 2018-11-06 00:40 HOU_JUN 阅读(537) 评论(0) 推荐(0) 编辑
摘要: #以SSD的检测测试为例 def detetion(image_dir,weight,deploy,resolution=300): caffe.set_mode_gpu() net = caffe.Net(weight,deploy,caffe.TEST) transformer = caffe.io.Transformer({'data': net.blobs['da... 阅读全文
posted @ 2018-11-06 00:37 HOU_JUN 阅读(1578) 评论(0) 推荐(0) 编辑
摘要: 这里注意的是:caffe.io.load_image()读入的像素值是[0-1]之间,且通道顺序为RGB,而caffe内部的数据格式是BGR,因此需要进行如下操作,若是使用opencv打开图片,则无需进行如下操作。 阅读全文
posted @ 2018-11-06 00:35 HOU_JUN 阅读(1933) 评论(0) 推荐(0) 编辑
摘要: # 编写一个函数,将二进制的均值转换为python的均值 def convert_mean(binMean,npyMean): blob = caffe.proto.caffe_pb2.BlobProto() bin_mean = open(binMean, 'rb' ).read() blob.ParseFromString(bin_mean) arr = np... 阅读全文
posted @ 2018-11-06 00:30 HOU_JUN 阅读(239) 评论(0) 推荐(0) 编辑
摘要: 如果想在训练过程中保存模型参数,调用 阅读全文
posted @ 2018-11-06 00:29 HOU_JUN 阅读(782) 评论(0) 推荐(0) 编辑
摘要: from caffe.proto import caffe_pb2 s = caffe_pb2.SolverParameter() path='/home/xxx/data/' solver_file=path+'solver.prototxt' #solver文件保存位置 s.train_net = path+'train.prototxt' # 训练配置文件 s.tes... 阅读全文
posted @ 2018-11-06 00:25 HOU_JUN 阅读(596) 评论(0) 推荐(0) 编辑
摘要: net.acc = caffe.layers.Accuracy(net.fc3,net.label) 输出: layer { name: "acc" type: "Accuracy" bottom: "fc3" bottom: "label" top: "acc" } 阅读全文
posted @ 2018-11-06 00:18 HOU_JUN 阅读(424) 评论(0) 推荐(0) 编辑
摘要: net.loss = caffe.layers.SoftmaxWithLoss(net.fc3, net.label) 输出: layer { name: "loss" type: "SoftmaxWithLoss" bottom: "fc3" bottom: "label" top: "loss" } 阅读全文
posted @ 2018-11-06 00:13 HOU_JUN 阅读(649) 评论(0) 推荐(0) 编辑
摘要: net.fc3 = caffe.layers.InnerProduct(net.pool1, num_output=1024, weight_filler=dict(type='xavier'), ... 阅读全文
posted @ 2018-11-06 00:10 HOU_JUN 阅读(463) 评论(0) 推荐(0) 编辑
摘要: net.mylrn = caffe.layers.LRN(net.pool1,local_size=5,alpha=1e-4,beta=0.75) 输出: layer { name: "mylrn" type: "LRN" bottom: "pool1" top: "lrn" lrn_param { local_size: 5 alpha: 9.999999... 阅读全文
posted @ 2018-11-06 00:07 HOU_JUN 阅读(340) 评论(0) 推荐(0) 编辑
摘要: net.pool1 = caffe.layers.Pooling(net.myconv, pool=caffe.params.Pooling.MAX, kernel_size=2, stride=2) 输出: layer { name: "pool1" type: "Pooling" bottom: "myconv" top: "pool1" pooling_param {... 阅读全文
posted @ 2018-11-06 00:04 HOU_JUN 阅读(318) 评论(0) 推荐(0) 编辑
摘要: import sys import os sys.path.append("/projects/caffe-ssd/python") import caffe net = caffe.NetSpec() net.data, net.label = caffe.layers.Data( name="InputData", source="train_lmdb", back... 阅读全文
posted @ 2018-11-06 00:01 HOU_JUN 阅读(803) 评论(0) 推荐(0) 编辑