TensorLow: FailedPreconditionError:Attempting to use uninitialized value Variable
来源:互联网 发布:linux 安装 jdk 编辑:程序博客网 时间:2024/06/05 03:37
问题:
FailedPreconditionError (see above for traceback): Attempting to use uninitialized value Variable[[Node: Variable/read = Identity[T=DT_FLOAT, _class=["loc:@Variable"], _device="/job:localhost/replica:0/task:0/cpu:0"](Variable)]]
出处:
constant_e = tf.Variable(tf.random_normal(shape=[2, 3],stddev=2, dtype=tf.float32))sess.run(constant_e)
原因:
Tensorflow中,所有变量都必须初始化才能使用。
方法:
init = tf.global_variables_initializer()sess.run(init)
结果:
constant_e = tf.Variable(tf.random_normal(shape=[2, 3], stddev=2, dtype=tf.float32))init = tf.global_variables_initializer()sess.run(init)print(sess.run(constant_e ))
阅读全文
0 0
- TensorLow: FailedPreconditionError:Attempting to use uninitialized value Variable
- 【Tensorflow】报错:FailedPreconditionError: Attempting to use uninitialized value keep_prob_7
- 使用tf.train.match_filenames_once()时报错FailedPreconditionError: Attempting to use uninitialized value X
- tensorflow.python.framework.errors_impl.FailedPreconditionError: Attempting to use uninitialized val
- TensorFlow计算AUC错误:Attempting to use uninitialized value auc/false_positives
- perl: Use of uninitialized value
- Use of uninitialized value $line in chomp
- Memcache SchoonerSockIOPool-attempting to get SockIO from uninitialized pool! 问题
- memcached 出现 Attempting to get SockIO from uninitialized pool!问题之根源
- ERROR com.schooner.MemCached.SchoonerSockIOPool - attempting to get SockIO from uninitialized pool
- How to Use Temporary Variable
- 阿录帮帮忙—memcached整合spring时:“attempting to get SockIO from uninitialized pool!”问题的解决
- Use of uninitialized value in concatenation (.) or string at test.pl line 232
- Use Ultraedit to extract variable declaration
- Use cursor_sharing_exact refused to SQL variable binding
- How to Use Input-type Variable
- How to Use Output-type Variable
- the greeter application appears to be crashing. attempting to use a different one...
- DPCP和C3P0的区别
- 日期格式的转换
- IOS编码GB2312与UTF-8互转
- No implementation found for int com.baidu.platform.comjni.engine.JNIEngine.initClass
- 浏览器缓存总结
- TensorLow: FailedPreconditionError:Attempting to use uninitialized value Variable
- 斐波那契+数颜色
- 图像处理-双边滤波原理
- android 链式调用
- KMP
- iOS开发-RunLoop的退出方式
- cvpr 2017 re-id papers
- 11.7 T3.B
- struct和typedef struct