TensorFlow and Numpy Issue M1

When following the instructions on installing TensorFlow on an M1 mac from Apples instructions I get the following error:

NotImplementedError: Cannot convert a symbolic Tensor (sequential/lstm/strided_slice:0) to a numpy array. This error may indicate that you're trying to pass a Tensor to a NumPy call, which is not supported

During install, or during use?

I got this error during use when I was trying to use numpy in a map function on my dataset. I got past it by converting to the equivalent logic with tf functions.

I also have this error during using the LSTM in TensorFlow. But when I reinstall numpy, a warning "tensorflow-macos 2.5.0 requires numpy~=1.19.2, but you have numpy 1.21.2 which is incompatible." shows. I can only install numpy 1.21.2 through pip.

Uninstall your numpy, and conda install numpy~=1.19.5, this will work.

numpy 1.20+ is not compatible with this tensorflow. https://github.com/tensorflow/tensorflow/issues/47691

Hi @Evan_yuik, can you please provide output of pip list when you see the error. As @Yookey mentioned there is a numpy version dependency with TF 2.5 version. In the tensorflow-deps meta-package we have chosen TF dependent package's version which are compatible with core Tensorflow v2.5. Does downgrading the numpy version to 1.19.5, help resolve the issue ?

TensorFlow and Numpy Issue M1
 
 
Q