AttributeError: module tensorflow has no attribute mul的解决
2019-03-17 14:31
阅读 1619
Traceback (most recent call last):
File "F:/ai/a2.py", line 86, in <module>
output = tf.mul(input1, input2)
AttributeError: module 'tensorflow' has no attribute 'mul'
tf.mul已经在新版本中被移除,请使用 tf.multiply
tf.matmul是矩阵的乘法,即tf.matmul(x,y)中的x和y要满足矩阵的乘法规则,例如x=[2,3],y=[3,2]
tf.multiply是两个矩阵对应的数据相乘,所以两个矩阵的形式必须相同,即tf.multiply(x,y)中x和 y具有相同的格式
例如x = [2,3],y= [2,3]
评论列表(0条)