NotImplementedError: Cannot convert a symbolic Tensor (2nd_target:0) to a numpy array

For me, the issue occurred when upgrading from numpy 1.19 to 1.20 and using ray‘s RLlib, which uses tensorflow 2.2 internally.
Simply downgrading with

pip install numpy==1.19.5

solved the problem; the error did not occur anymore.

Update (comment by @codeananda): You can also update to a newer TensorFlow (2.6+) version now that resolves the problem (pip install -U tensorflow).

Leave a Comment