import tensorflow as tf
#save to file
#remember to define same dtype and shape when restore
#W = tf.Variable(tf.truncated_normal([2, 3]),dtype=tf.float32,name='weight')
#b = tf.Variable(tf.truncated_normal([3]),dtype=tf.float32,name='biases')#dtype不定义会报错
#
#init = tf.global_variables_initializer()
#
#saver = tf.train.Saver()
#
#with tf.Session() as sess:
# sess.run(init)
# #save sess 里所有的东西,格式注意.ckpt,可以是别的格式
# save_path = saver.save(sess,"mynet/savetest1.ckpt")
# print("save path:" , save_path)
#restore variable
#redefine same dtype and shape for you variables
W = tf.Variable(tf.truncated_normal([2, 3]),dtype = tf.float32,name = '
Key Conv/biases not found in checkpoint
最新推荐文章于 2025-06-03 09:00:47 发布