Python tensorflow ValueError: Parent directory of my_test_model doesn't exist, can't save.

在使用TensorFlow训练模型并尝试保存时遇到`ValueError: Parent directory of my_test_model doesn't exist, can't save.`的问题。通过指定完整路径,如`saver.save(sess, './test/my_test_model', global_step=1000)`,解决了该问题,成功保存了模型。保存后的文件包括:checkpoint、my_test_model-1000.data-00000-of-00001、my_test_model-1000.index和my_test_model-1000.meta。" 132771069,19673459,C语言#include的妙用:探索编程新技巧,"['c语言', '编程技巧', '模块化编程', '内联函数']
摘要由CSDN通过智能技术生成
import tensorflow as tf  
w1 = tf.Variable(tf.random_normal(shape=[2]), name='w1')  
w2 = tf.Variable(tf.random_normal(shape=[5]), name='w2')  
saver = tf.train.Saver([w1,w2])  
sess = tf.Session()  
sess.run(tf.global_variables_initializer())  
saver.save(sess, 'my_test_model',global_step=1000)

出现错误:

wu@wu-X555LF:~/test$ python tf_test1.py 
2019-08-10 12:56:26.243857: I tensorflow/core/platform/cpu_feature_guard.cc:140] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2019-08-10 12:56:26.330550: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:898] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2019-08-10 12:56:26.330992: I tensorflow/core/common_runtime/gpu/gpu_device.c
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值