![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
tensorflow
zchenack
这个作者很懒,什么都没留下…
展开
-
Tensorflow常见模型实现之二(CNN)
1. multi-channel CNN import tensorflow as tfimport tensorflow.contib as contribfrom tensorflow.python.ops import array_opsfrom tensorflow.python.framework import dtypesclass cnn(object): d...原创 2018-10-21 15:59:02 · 476 阅读 · 0 评论 -
tensorflow的模型文件ckpt参数获取
已知模型文件的ckpt文件,通过pywrap_tensorflow获取模型的各参数名import tensoflow as tffrom tensorflow.python import pywrap_tensorflowmodel_dir = "./ckpt/"ckpt = tf.train.get_checkpoint_state(model_dir)ckpt_path = ...原创 2018-11-01 18:57:12 · 7178 阅读 · 3 评论 -
tensorflow模型打包成PB文件及PB文件读取
1. tensorflow模型文件打包成PB文件import tensorflow as tffrom tensorflow.python.tools import freeze_graphwith tf.Graph().as_default(): with tf.device("/cpu:0"): config = tf.ConfigProto(allow_s...原创 2018-11-02 20:31:41 · 6421 阅读 · 1 评论 -
Tensorflow实现部分参数梯度更新
在深度学习中,迁移学习经常被使用,在大数据集上预训练的模型迁移到特定的任务,往往需要保持模型参数不变,而微调与任务相关的模型层。本文主要介绍,使用tensorflow部分更新模型参数的方法。1. 根据Variable scope剔除需要固定参数的变量 def get_variable_via_scope(scope_lst): vars = [] for sc in sc...原创 2018-12-04 21:00:03 · 10047 阅读 · 3 评论