How to convert “tensor” to “numpy” array in tensorflow?
问题 I am trying to convert a tensor to numpy in the tesnorflow2.0 version. Since tf2.0 have eager execution enabled then it should work by default and working too in normal runtime. While I execute code in tf.data.Dataset API then it gives an error "AttributeError: 'Tensor' object has no attribute 'numpy'" I have tried ".numpy()" after tensorflow variable and for ".eval()" I am unable to get default session. from __future__ import absolute_import, division, print_function, unicode_literals import