caffe 网络结构查看 prototxt

step 1. 进入 http://ethereon.github.io/netscope/#/editor

step 2. 将 net.prototxt 内容粘贴到左侧编辑框内,  按 Shift + Enter 即可在右侧查看网络结构, 鼠标放单个节点上可以查看节点的输入、输出及参数配置

# Enter your network definition here.
# Use Shift+Enter to update the visualization.
name: "ENet"
input: "data"
input_dim: 1
input_dim: 3
input_dim: 24 
input_dim: 48 

layer {
  name: "conv1"
  type: "Convolution"
  bottom: "data"
  top: "conv1"
  param {
    lr_mult: 1
    decay_mult: 1
  }
  param {
    lr_mult: 2
    decay_mult: 0
  }
  convolution_param {
    num_output: 10
    kernel_size: 3
    stride: 1
    weight_filler {
      type: "xavier"
    }
    bias_filler {
      type: "constant"
      value: 0
    }
  }
}
layer {
  name: "ReLU1"
  type: "ReLU"
  bottom: "conv1"
  top: "conv1"
}
layer {
  name: "pool1"
  type: "Pooling"
  bottom: "conv1"
  top: "pool1"
  pooling_param {
    pool: MAX
    kernel_size: 2
    stride: 2
    pad: 0
  }
}
##------
layer {
  name: "conv1_2"
  type: "Convolution"
  bottom: "data"
  top: "conv1_2"
  param {
    lr_mult: 1
    decay_mult: 1
  }
  param {
    lr_mult: 2
    decay_mult: 0
  }
  convolution_param {
    num_output: 10
    kernel_size: 5
    stride: 1
    weight_filler {
      type: "xavier"
    }
    bias_filler {
      type: "constant"
      value: 0
    }
  }
}
layer {
  name: "ReLU1"
  type: "ReLU"
  bottom: "conv1_2"
  top: "conv1_2"
}
layer {
  name: "pool1_2"
  type: "Pooling"
  bottom: "conv1_2"
  top: "pool1_2"
  pooling_param {
    pool: MAX
    kernel_size: 2
    stride: 2
    pad: 0
  }
}
# conv 2_2
layer {
  name: "conv2_2"
  type: "Convolution"
  bottom: "pool1_2"
  top: "conv2_2"
  param {
    lr_mult: 1
    decay_mult: 1
  }
  param {
    lr_mult: 2
    decay_mult: 0
  }
  convolution_param {
    num_output: 16 
    kernel_size: 2
    stride: 1
     weight_filler {
      type: "xavier"
    }
    bias_filler {
	  type: "constant"
      value: 0
    }
  }
}
layer {
  name: "ReLU2_2"
  type: "ReLU"
  bottom: "conv2_2"
  top: "conv2_2"
}

#----
layer {
  name: "conv2"
  type: "Convolution"
  bottom: "pool1"
  top: "conv2"
  param {
    lr_mult: 1
    decay_mult: 1
  }
  param {
    lr_mult: 2
    decay_mult: 0
  }
  convolution_param {
    num_output: 64 
    kernel_size: 3
    stride: 1
     weight_filler {
      type: "xavier"
    }
    bias_filler {
      type: "constant"
      value: 0
    }
  }
}
layer {
  name: "ReLU2"
  type: "ReLU"
  bottom: "conv2"
  top: "conv2"
}
#layer {
#  name: "pool2"
#  type: "Pooling"
#  bottom: "conv2"
#  top: "pool2"
#  pooling_param {
#    pool: MAX
#    kernel_size: 2
#    stride: 2
#    pad: 0
#  }
#}

# concat
layer {
   name: "concat"
   type: "Concat"
   bottom: "conv2_2"
   bottom: "conv2"
   top : "conout"
   concat_param {
       axis: 1
   }
}
# concat


layer {
  name: "conv3"
  type: "Convolution"
  bottom: "conout"
  top: "conv3"
  param {
    lr_mult: 1
    decay_mult: 1
  }
  param {
    lr_mult: 2
    decay_mult: 0
  }
  convolution_param {
    num_output: 16 
    kernel_size: 1
    stride: 1
     weight_filler {
      type: "xavier"
    }
    bias_filler {
	  type: "constant"
      value: 0
    }
  }
}
layer {
  name: "ReLU3"
  type: "ReLU"
  bottom: "conv3"
  top: "conv3"
}
layer{
  name: "transpose1"
  type: "Transpose"
  bottom: "conv3"
  top: "perm1"
  transpose_param { dim: 0 dim: 2 dim: 3 dim: 1 }
}


layer {
  name: "fc1"
  type: "InnerProduct"
  bottom: "perm1"
  top: "fc1"
  param {
    lr_mult: 0
    decay_mult: 0
  }
  param {
    lr_mult: 0
    decay_mult: 0
  }
  inner_product_param {
    num_output: 8 
    weight_filler {
      type: "xavier"
      }
    bias_filler {
      type: "constant"
      value: 0
    }
  }
}
layer {
  name: "fc2"
  type: "InnerProduct"
  bottom: "fc1"
  top: "fc2"
  param {
    lr_mult: 0
    decay_mult: 0
  }
  param {
    lr_mult: 0
    decay_mult: 0
  }
  inner_product_param {
    num_output: 2 
    weight_filler {
      type: "xavier"
      }
    bias_filler {
      type: "constant"
      value: 0
    }
  }
}

layer {
  name: "prob1"
  type: "Softmax"
  bottom: "fc2"
  top: "prob1"
}

2020.11.02 其他工具更新:

https://github.com/lutzroeder/netron

https://github.com/lutzroeder/netron/releases/download/v4.6.0/Netron-Setup-4.6.0.exe

https://netron.app/  网页版

评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值