Invalid factor level, na generated
How to convert tensor to numpy array when using Tensorflow with Python bindings?
For your problem, Tensor returned by Session.run() or tf.eval() is already a NumPy array, except for Sparse tensor, they return Sparse value.
For example:
>>> print(type(tf.Session().run(tf.constant([1,2,3]))))
Or
>>> sess = tf.InteractiveSession()
>>> print(type(tf.constant([1,2,3]).eval()))
Or
>>> sess = tf.Session()
>>> with sess.as_default():
>>> print(type(tf.constant([1,2,3]).eval()))
Hope this answer helps you convert tensor to NumPy array.