码迷,mamicode.com
首页 > 其他好文 > 详细

TF:利用TF的train.Saver将训练好的variables(W、b)保存到指定的index、meda文件

时间:2018-01-25 23:13:40      阅读:610      评论:0      收藏:0      [点我收藏+]

标签:bsp   with   div   lob   oba   int   style   on()   name   

import tensorflow as tf
import numpy as np

W = tf.Variable([[2,1,8],[1,2,5]], dtype=tf.float32, name=weights)
b = tf.Variable([[1,2,5]], dtype=tf.float32, name=biases)
  
init= tf.global_variables_initializer()  
  
saver = tf.train.Saver()     
  
with tf.Session() as sess:   
    sess.run(init)
    save_path = saver.save(sess, "niu/save_net.ckpt") 
    print("Save to path: ", save_path)       

 

TF:利用TF的train.Saver将训练好的variables(W、b)保存到指定的index、meda文件

标签:bsp   with   div   lob   oba   int   style   on()   name   

原文地址:https://www.cnblogs.com/yunyaniu/p/8353435.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!