profile
viewpoint

Ask questionsTF 2.0 'Tensor' object has no attribute 'numpy' while using .numpy() although eager execution enabled by default

Although Eager_execution is enabled by default in TF 2.0, I am getting errors while using .numpy()

Please note that i am not using the code in compatibility mode to TF 1.0.

expt = [[[ 0, 0, 0], [ 4, 71, 141], [ 0, 0, 0]],

       [[ 83,  25,  85],
        [ 90, 190, 143],
        [  4, 141,  49]],

       [[  0,   0,   0],
        [  4,  71,  49],
        [  0,   0,   0]]]

expt = tf.convert_to_tensor(expt)

expected_values = expt.numpy()

AttributeError: 'Tensor' object has no attribute 'numpy'

CPU TEST VERSION OF TENSORFLOW 2.0.

tensorflow/tensorflow

Answer questions Mainak431

Yes.

useful!

Related questions

ModuleNotFoundError: No module named 'tensorflow.contrib' hot 8
Error occurred when finalizing GeneratorDataset iterator hot 7
tensorflow-gpu CUPTI errors
Error loading tensorflow
ModuleNotFoundError: No module named 'tensorflow.contrib'
module 'tensorflow' has no attribute 'ConfigProto'
When importing TensorFlow, error loading Hadoop
AttributeError: module 'tensorflow.python.framework.op_def_registry' has no attribute 'register_op_list'
tf.keras.layers.Conv1DTranspose ?
[TF 2.0] tf.keras.optimizers.Adam hot 4
Lossy conversion from float32 to uint8. Range [0, 1]. Convert image to uint8 prior to saving to suppress this warning. hot 4
TF2.0 AutoGraph issue hot 4
Tf.Keras metrics issue hot 4
ModuleNotFoundError: No module named 'tensorflow.examples.tutorials' hot 4
module 'tensorflow.python._pywrap_tensorflow_internal' has no attribute 'TFE_NewContextOptions' hot 4
Github User Rank List