admin管理员组

文章数量:1550528

问题描述:NotImplementedError: Cannot convert a symbolic Tensor (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

错误分析:无法将一个张量传进numpy array,经过多方查询,是因为tensorflow的版本与numpy版本不一致导致的,我使用的tensorflow版本是2.4.0 对应的numpy应该为1.19.5

首先现在原本的numpy
pip uninstall numpy
然后安装正确的numpy
pip install numpy==1.19.5

但当我安装好新的numpy后 报了这个错误:
ValueError: numpy.ufunc size changed, may indicate binary incompatibility. Expected 216 from C header, got 192 from PyObject
错误分析:TA_Lib版本与numpy版本不一致导致的,我使用的原来的版本是talib 0.4.21 是最新版,版本换成0.4.19即可,安装talib的时候可能用pip install 会出现红色错误,这里建议直接从网上下载whl进行本地安装

本文标签: SymbolicTensorNotImplementedErrorConvertnumpy