python - 'Tensor' object has no attribute 'numpy' in tf ...
stackoverflow.com › questions › 55596547Apr 09, 2019 · If you have a non decorated function, you correctly can use numpy() to extract the value of a tf.Tensor. def f(): a = tf.constant(10) tf.print("a:", a.numpy()) When you decorate the function, the tf.Tensor object changes semantic, becoming a Tensor of a computational Graph (the plain old tf.Graph object), therefore the .numpy() method disappear and if you want to get the value of the tensor ...