Caffe使用训练好的GoogleNet进行图像识别

本文详细介绍了如何利用Caffe深度学习框架,结合预先训练好的GoogleNet模型,进行图像识别任务。通过步骤分解,包括模型加载、预处理、前向传播等关键环节,帮助读者掌握在实际项目中应用Caffe进行图像识别的方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

                                                                                                                                           点击此处返回总目录

 

这节课讲解怎么在caffe中使用GoogleNet来实现图像的识别。

 

一、 到caffe的GitHub上去下载训练好的GoogleNet模型。

    地址:https://github.com/BVLC/caffe

    models->bvlc_googlenet->点击下面的链接,下载。

    

提醒:不要半夜下载。可能是关闭的,半夜下不下来。

 

下载完后为:,有51M。

放到caffe-master\models\bvlc_googlenet文件夹下。

 

我们可以看一下GoogleNet的网络结构,使用绘图工具。比较恶心,就不粘上了。解释一下网络结构吧

//deploy.prototxt(不全,拿了一部分)

name: "GoogleNet"
layer {
  name: "data"
  type: "Input"
  top: "data"
  input_param { shape: { dim: 10 dim: 3 dim: 224 dim: 224 } }         //一个批次10张图片。彩色图片。
}
layer {
  name: "conv1/7x7_s2"
  type: "Convolution"
  bottom: "data"
  top: "conv1/7x7_s2"
  param {
    lr_mult: 1
    decay_mult: 1
  }
  param {
    lr_mult: 2
    decay_mult: 0
  }
  convolution_param {
    num_output: 64
    pad: 3                                      #外面补3圈0
    kernel_size: 7
    stride: 2
    weight_filler {
      type: "xavier"
      std: 0.1                                #标准差。但是对于"xavier"算法来说没用。当type为其他类型时,比如高斯算法时有用。
    }
    bias_filler {
      type: "constant"                    #常数。为0.2。如果不设置就是0
      value: 0.2
    }
  }
}
layer {
  name: "conv1/relu_7x7"
  type: "ReLU"
  bottom: "conv1/7x7_s2"
  top: "conv1/7x7_s2"
}
layer {
  name: "pool1/3x3_s2"
  type: "Pooling"
  bottom: "conv1/7x7_s2"
  top: "pool1/3x3_s2"
  pooling_param {
    pool: MAX

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值