-
大小: 96.59MB文件类型: .zip金币: 1下载: 0 次发布日期: 2023-06-25
- 语言: 其他
- 标签: tensorflow ssd
资源简介
github上的资源转载,为没有注册github账号或者下载没找到资源的道友服务
代码片段和文件信息
“““Convert a Caffe model file to TensorFlow checkpoint format.
Assume that the network built is a equivalent (or a sub-) to the Caffe
definition.
“““
import tensorflow as tf
from nets import caffe_scope
from nets import nets_factory
slim = tf.contrib.slim
# =========================================================================== #
# Main flags.
# =========================================================================== #
tf.app.flags.DEFINE_string(
‘model_name‘ ‘ssd_300_vgg‘ ‘Name of the model to convert.‘)
tf.app.flags.DEFINE_string(
‘num_classes‘ 21 ‘Number of classes in the dataset.‘)
tf.app.flags.DEFINE_string(
‘caffemodel_path‘ None
‘The path to the Caffe model file to convert.‘)
FLAGS = tf.app.flags.FLAGS
# =========================================================================== #
# Main converting routine.
# =========================================================================== #
def main(_):
# Caffe scope...
caffemodel = caffe_scope.CaffeScope()
caffemodel.load(FLAGS.caffemodel_path)
tf.logging.set_verbosity(tf.logging.INFO)
with tf.Graph().as_default():
global_step = slim.create_global_step()
num_classes = int(FLAGS.num_classes)
# Select the network.
ssd_class = nets_factory.get_network(FLAGS.model_name)
ssd_params = ssd_class.default_params._replace(num_classes=num_classes)
ssd_net = ssd_class(ssd_params)
ssd_shape = ssd_net.params.img_shape
# Image placeholder and model.
shape = (1 ssd_shape[0] ssd_shape[1] 3)
img_input = tf.placeholder(shape=shape dtype=tf.float32)
# Create model.
with slim.arg_scope(ssd_net.arg_scope_caffe(caffemodel)):
ssd_net.net(img_input is_training=False)
init_op = tf.global_variables_initializer()
with tf.Session() as session:
# Run the init operation.
session.run(init_op)
# Save model in checkpoint.
saver = tf.train.Saver()
ckpt_path = FLAGS.caffemodel_path.replace(‘.caffemodel‘ ‘.ckpt‘)
saver.save(session ckpt_path write_meta_graph=False)
if __name__ == ‘__main__‘:
tf.app.run()
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2017-04-10 13:56 SSD-Tensorflow-master\
文件 444 2017-04-10 13:56 SSD-Tensorflow-master\.gitignore
文件 12024 2017-04-10 13:56 SSD-Tensorflow-master\COMMANDS.md
文件 9293 2017-04-10 13:56 SSD-Tensorflow-master\README.md
文件 2227 2017-04-10 13:56 SSD-Tensorflow-master\caffe_to_tensorflow.py
目录 0 2017-04-10 13:56 SSD-Tensorflow-master\checkpoints\
文件 97721959 2017-04-10 13:56 SSD-Tensorflow-master\checkpoints\ssd_300_vgg.ckpt.zip
目录 0 2017-04-10 13:56 SSD-Tensorflow-master\datasets\
文件 1 2017-04-10 13:56 SSD-Tensorflow-master\datasets\__init__.py
文件 3218 2017-04-10 13:56 SSD-Tensorflow-master\datasets\cifar10.py
文件 2112 2017-04-10 13:56 SSD-Tensorflow-master\datasets\dataset_factory.py
文件 4696 2017-04-10 13:56 SSD-Tensorflow-master\datasets\dataset_utils.py
文件 7483 2017-04-10 13:56 SSD-Tensorflow-master\datasets\imagenet.py
文件 3403 2017-04-10 13:56 SSD-Tensorflow-master\datasets\pascalvoc_2007.py
文件 2869 2017-04-10 13:56 SSD-Tensorflow-master\datasets\pascalvoc_2012.py
文件 4753 2017-04-10 13:56 SSD-Tensorflow-master\datasets\pascalvoc_common.py
文件 8668 2017-04-10 13:56 SSD-Tensorflow-master\datasets\pascalvoc_to_tfrecords.py
目录 0 2017-04-10 13:56 SSD-Tensorflow-master\demo\
文件 78771 2017-04-10 13:56 SSD-Tensorflow-master\demo\000001.jpg
文件 113300 2017-04-10 13:56 SSD-Tensorflow-master\demo\000002.jpg
文件 123361 2017-04-10 13:56 SSD-Tensorflow-master\demo\000003.jpg
文件 102770 2017-04-10 13:56 SSD-Tensorflow-master\demo\000004.jpg
文件 79789 2017-04-10 13:56 SSD-Tensorflow-master\demo\000006.jpg
文件 82702 2017-04-10 13:56 SSD-Tensorflow-master\demo\000008.jpg
文件 106000 2017-04-10 13:56 SSD-Tensorflow-master\demo\000010.jpg
文件 102396 2017-04-10 13:56 SSD-Tensorflow-master\demo\000022.jpg
文件 163759 2017-04-10 13:56 SSD-Tensorflow-master\demo\dog.jpg
文件 141886 2017-04-10 13:56 SSD-Tensorflow-master\demo\eagle.jpg
文件 133495 2017-04-10 13:56 SSD-Tensorflow-master\demo\horses.jpg
文件 113880 2017-04-10 13:56 SSD-Tensorflow-master\demo\person.jpg
文件 447571 2017-04-10 13:56 SSD-Tensorflow-master\demo\street.jpg
............此处省略43个文件信息
相关资源
- weights_SSD300.hdf5
- TensorFlow实战Google深度学习框架(随书
- TensorFlow实战Google深度学习框架
- 面向机器智能的TensorFlow实践 高清完整
- tensorflow_gpu-1.12.0-cp37
- TensorFlow教程
- Tensorflow2.0 Transformer模型中英翻译.ra
- 分布式深度学习论文tensorflow的并行计
- TensorFlow机器学习项目实战.epub
- Tensorflow内核剖析 电子书
- tensorflow车牌号码识别源码
- 《深度学习之TensorFlow:入门、原理与
- hands-on machine learning with scikit-learn an
- tensorflow lite 依赖包
- tensorFlow keras 深度学习 人工智能实践
- PCIE NVME for win7驱动,制作启动U盘最好
- Tensorflow手写字体识别入门
- Comprehensive_Experiment.zip
- LSTM的PTB数据集
- 街机游戏C-DogsSDL.zip
- Sklearn与TensorFlow 机器学习实用指南翻
- 《深度学习之TensorFlow:入门、原理与
- tensorflow-resnet-inception网络
- 强化学习精要 核心算法与TensorFlow实现
- 《Tensorflow:实战Google深度学习框架》
- 基于深度学习的图像去雨
- tensorflow深度学习三部曲.rar
- models_VGGNet_VOC0712_SSD_300x300.tar.gz
- models_VGGNet_VOC0712Plus_SSD_300x300_ft.tar.g
- 21个项目玩转tensorflow.zip
评论
共有 条评论