RELATEED CONSULTING
相关咨询
选择下列产品马上在线沟通
服务时间:8:30-17:00
你可能遇到了下面的问题
关闭右侧工具栏

新闻中心

这里有您想知道的互联网营销解决方案
Tensorflow1.0之后模型文件、权重数值的读取方式是什么

本篇内容主要讲解“Tensorflow1.0之后模型文件、权重数值的读取方式是什么”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“Tensorflow1.0之后模型文件、权重数值的读取方式是什么”吧!

创新互联公司主要从事成都做网站、成都网站设计、网页设计、企业做网站、公司建网站等业务。立足成都服务坡头,十余年网站建设经验,价格优惠、服务专业,欢迎来电咨询建站服务:18980820575

保存的文件有4个:

checkpoint

model-parameters.bin-46000.data-00000-of-00001

model-parameters.bin-46000.index

model-parameters.bin-46000.meta

读取代码:

from tensorflow.python import pywrap_tensorflowwith tf.Graph().as_default(): with tf.Session() as sess: ckpt = tf.train.get_checkpoint_state('./checkpoint') if ckpt and ckpt.model_checkpoint_path:  reader = pywrap_tensorflow.NewCheckpointReader('./checkpoint/model-parameters.bin-46000')  all_variables = reader.get_variable_to_shape_map()  w1 = reader.get_tensor("conv1/weight")  print(w1.shape)  print(w1)  print(all_variables) else:  print('No checkpoint file found')

到此,相信大家对“Tensorflow1.0之后模型文件、权重数值的读取方式是什么”有了更深的了解,不妨来实际操作一番吧!这里是创新互联网站,更多相关内容可以进入相关频道进行查询,关注我们,继续学习!


本文标题:Tensorflow1.0之后模型文件、权重数值的读取方式是什么
浏览地址:http://sczitong.cn/article/gssgeh.html