我正在处理tensorflow 0.12并且遇到了铸造问题。 下面的代码片段做了一件怪事:Tensorflow - 从int转换为浮动奇怪行为
sess = tf.InteractiveSession()
a = tf.constant(1)
b = tf.cast(a, tf.float32)
print b.eval()
我得到一个值: 6.86574233e-36
我也使用tf.to_float()
和tf.saturate_cast
尝试。两者都给出了相同的结果。
请帮忙。
我无法在TF 1.0中重现您的问题。 – MikiBear
你是否在gpu上运行Tensorflow,如果是,你使用的是什么gpu卡? Tensorflow编译了哪些cuda版本?有时候,当使用不受cuda版本支持的GPU时,会发生奇怪的事情而没有任何错误消息。 – BlueSun
嗨,我在CPU上运行:英特尔至强E5-2680 – aarbelle