资源简介
已训练好的VGGNet模型可导入直接使用。具体使用说明可参考https://blog.csdn.net/u010677365/article/details/80881040。
代码片段和文件信息
from __future__ import print_function
import caffe
from caffe.model_libs import *
from google.protobuf import text_format
import math
import os
import shutil
import stat
import subprocess
import sys
# Add extra layers on top of a “base“ network (e.g. VGGNet or Inception).
def AddExtralayers(net use_batchnorm=True lr_mult=1):
use_relu = True
# Add additional convolutional layers.
# 19 x 19
from_layer = net.keys()[-1]
# TODO(weiliu89): Construct the name using the last layer to avoid duplication.
# 10 x 10
out_layer = “conv6_1“
ConvBNlayer(net from_layer out_layer use_batchnorm use_relu 256 1 0 1
lr_mult=lr_mult)
from_layer = out_layer
out_layer = “conv6_2“
ConvBNlayer(net from_layer out_layer use_batchnorm use_relu 512 3 1 2
lr_mult=lr_mult)
# 5 x 5
from_layer = out_layer
out_layer = “conv7_1“
ConvBNlayer(net from_layer out_layer use_batchnorm use_relu 128 1 0 1
lr_mult=lr_mult)
from_layer = out_layer
out_layer = “conv7_2“
ConvBNlayer(net from_layer out_layer use_batchnorm use_relu 256 3 1 2
lr_mult=lr_mult)
# 3 x 3
from_layer = out_layer
out_layer = “conv8_1“
ConvBNlayer(net from_layer out_layer use_batchnorm use_relu 128 1 0 1
lr_mult=lr_mult)
from_layer = out_layer
out_layer = “conv8_2“
ConvBNlayer(net from_layer out_layer use_batchnorm use_relu 256 3 0 1
lr_mult=lr_mult)
# 1 x 1
from_layer = out_layer
out_layer = “conv9_1“
ConvBNlayer(net from_layer out_layer use_batchnorm use_relu 128 1 0 1
lr_mult=lr_mult)
from_layer = out_layer
out_layer = “conv9_2“
ConvBNlayer(net from_layer out_layer use_batchnorm use_relu 256 3 0 1
lr_mult=lr_mult)
return net
### Modify the following parameters accordingly ###
# Notice: we do evaluation by setting the solver parameters approximately.
# The reason that we do not use ./build/tools/caffe test ... is because it
# only supports testing for classification problem now.
# The directory which contains the caffe code.
# We assume you are running the script at the CAFFE_ROOT.
caffe_root = os.getcwd()
# Set true if you want to start training right after generating all files.
run_soon = True
# The database file for training data. Created by data/VOC0712/create_data.sh
train_data = “examples/VOC0712/VOC0712_trainval_lmdb“
# The database file for testing data. Created by data/VOC0712/create_data.sh
test_data = “examples/VOC0712/VOC0712_test_lmdb“
# Specify the batch sampler.
resize_width = 300
resize_height = 300
resize = “{}x{}“.format(resize_width resize_height)
batch_sampler = [
{
‘sampler‘: {
}
‘max_trials‘: 1
‘max_sample‘: 1
}
{
‘sampler‘: {
‘min_scale‘: 0.3
‘max_scale‘: 1.0
- 上一篇:gradle-3.5-all.zip 官方绿色版
- 下一篇:cgi实现文件
相关资源
- HigherHRNet预训练模型
- inception_resnet_v2_2016_08_30预训练模型
- YOLOV3 预训练模型 darknet53.conv.74.zip
- VGG16 model for Keras
- U2Net 网络预训练模型u2net.pth
- MobileNet V1官方预训练模型的使用
- places205CNN_deploy30万次预训练模型caff
- pytorch-resnet18和resnet50官方预训练模型
- caffe-SSD网络预训练模型
- facenet亚洲人脸训练模型
- VGG19预训练模型不包括全连接层
- Resnet 50 权重文件
- faster_rcnn_models训练模型的地址
- kears下imageNet数据集的预训练模型
- facenet预训练模型
- 用自己的数据进行CaffeNet训练模型
- resnet各种预训练模型
- mask_rcnn训练模型pb文件转pbtxt文件
- Faster-Rcnn-TF预训练模型
- crowdcount-mcnn-master复现的预训练模型
- VGG预训练模型链接
- 2.tensorflow数据读取、训练模型、测试
评论
共有 条评论