代码使用张力流.mul()升级到tensorflow v1.0后失败

2024-10-01 11:29:28 发布

您现在位置:Python中文网/ 问答频道 /正文

这段代码运行在tensorflowv0.12.1上,但在tfv1.0上的新安装上失败了。是不是这个函数被弃用了?我应该用什么功能?(Tensorflow开始运行,所以我相信这不是配置错误)

  File "***.py", line 115, in trainNetwork
    readout_action = tf.reduce_sum(tf.mul(readout, a), reduction_indices = 1)
AttributeError: module 'tensorflow' has no attribute 'mul'

Tags: 函数inpy功能reducetftensorflow错误
2条回答

对于您的信息,tf.multf.sub和{}在以前的张量流版本中使用过。它们已被弃用。
您可以改为使用tf.multiplytf.subtract和{}。 谢谢。在

在TensorFlow 1.0中,tf.mul()函数已重命名为tf.multiply()。在

相关问题 更多 >