with tf.compat.v1.Session() as sess:
model = Model(reversed_dict, article_max_len, summary_max_len, args)
sess.run(tf.compat.v1.global_variables_initializer())
saver = tf.compat.v1.train.Saver(tf.compat.v1.global_variables())
我得到这个错误:
---------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-19-42e9e3d94e79> in <module>
37 model = Model(reversed_dict, article_max_len, summary_max_len, args)
38 sess.run(tf.compat.v1.global_variables_initializer())
---> 39 saver = tf.compat.v1.train.Saver(tf.compat.v1.global_variables())
ValueError: No variables to save
我想通过初始化全局变量来创建“要保存的变量”??是否有从tf1到tf2.0的中断
背景:这是tensorflow 1.0代码,我将其升级为2.0
目前没有回答
相关问题 更多 >
编程相关推荐