Open Source/TensorFlow
[에러] 'module' object has no attribute 'mul'
editor2080
2018. 7. 19. 08:35
tensorflow 라이브러리 사용 시 다음과 같은 에러 발생 시
1 2 3 4 5 | >>> y = tf.mul(a, b) Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: 'module' object has no attribute 'mul' | cs |
해당 속성이 없으므로 사용할 수 없다는 에러인데 TF 버전에 따라 해당 API 및 일부 API가 변경되었기 때문에 다음과 같이 사용합니다.
: tf.mul -> tf.multiply
: tf.sub -> tf.subtract
: tf.neg -> tf.negative