close

[Solved] NotImplementedError: Cannot convert a symbolic Tensor (lstm_2/strided_slice:0) to a numpy array

Hello Guys, How are you all? Hope You all Are Fine. Today in Python. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How NotImplementedError: Cannot convert a symbolic Tensor (lstm_2/strided_slice:0) to a numpy array Error Occurs ?

I am using tensorflow version 2.3.1 numpy version 1.20 and trying to run my code. But I got following error in my stacktrack

NotImplementedError: Cannot convert a symbolic Tensor (lstm_2/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

How To Solve NotImplementedError: Cannot convert a symbolic Tensor (lstm_2/strided_slice:0) to a numpy array Error ?

  1. How To Solve NotImplementedError: Cannot convert a symbolic Tensor (lstm_2/strided_slice:0) to a numpy array Error ?

    To Solve NotImplementedError: Cannot convert a symbolic Tensor (lstm_2/strided_slice:0) to a numpy array Just downgrade NumPy to 1.18.5 just run this command pip install -U numpy==1.18.5

Solution 1: downgrade numpy

Just downgrade NumPy to 1.18.5

pip install -U numpy==1.18.5

Solution 2: downgrading python

Just downgrading python from 3.8 to 3.6

Solution 3: Tensorflow 

TensorFlow and TensorFlow-GPU 2.5 packages still include NumPy-1.19.5 as a dependency.
The error referenced in this post will be reproduced if TensorFlow 2.5 installation is mixed with numpy>1.19.5.
TensorFlow-2.5, NumPy-1.19.5 are compatible with python-3.9

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you?

Also Read

Please Rate Our Solution to Motivate Us For Give Our Best

Leave a Comment