caffe_基础

Caffe (Convolution Architecture For Feature Embedding
(Extraction))
网络各层详细解释
http://caffe.berkeleyvision.org/tutorial/layers.html
Questions:
1. 从中断处开始训练
caffe train ­solver solver.prototxt ­snapshot train_1000.solverstate
https://github.com/BVLC/caffe/wiki/Training-and-Resuming
2. 可视化卷积层
name: "myconvnet"
input: "data"
input_dim: 1
input_dim: 1
input_dim: 256
input_dim: 256
layer {
name: "conv"
type: "Convolution"
bottom: "data"
top: "conv"
convolution_param {
num_output: 10
kernel_size: 3
stride: 1
weight_filler {
type: "gaussian"
std: 0.01
} b
ias_filler {
type: "constant"
value: 0
}
}
}
$ pip insall pydot
$ sudo apt­get install graphviz libgraphviz­dev
$ pip install pygraphviz
$ python /path/to/caffe/python/draw_net.py myconvnet.prototxt
myconvnet.png
3. 什么样的 layer 才能它的 bottom 和 top 可以是相同的名称?
目前只有 Relu 层它的上下层可以使用相同名称,因为它是 element-wise 的,
所以可以使用 in-place 的操作以节省内存
http://caffe.berkeleyvision.org/tutorial/interfaces.html
4. 测试网络
impoort sys
sys.path.insert(0, '/path/to/caffe/python')
import numpy as np
import cv2
from pylab import * #画图
import caffe
#initialize

caffe.set_device(1)
caffe.set_mode_gpu()
#指定使用哪一块GPU
#指定GPU计算

 

model_def = 'deploy.prototxt'
model_weight = 'net.cafffemodel'
#给定网络模型
#给定参数
net = caffe.Net(model_def, model_weight, caffe.TEST)#给定phase =
TEST,那么网络只会向前计算,不会 backpropagation

Net instance:
1. Mnist
http://caffe.berkeleyvision.org/gathered/examples/mnist.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值