在这里插入图片描述


一、Bug展示

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

二、分析原因

这个错误通常是在将 tensorflow 张量转换为 NumPy 数组时发生的。通常,这可能是因为我们尝试使用不兼容的类型转换将张量转换为 NumPy 数组,或者尝试在需要 tensorflow 张量的情况下将其传递给接受 NumPy 数组的函数。意思就是tensorflow的版本过高或者numpy的版本过高,我们可以降低版本。

三、解决方法

1. 安装低版本numpy

在这里插入图片描述

pip install  numpy==1.19.1 -i https://pypi.tuna.tsinghua.edu.cn/simple

2. 安装低版本tensorflow

在这里插入图片描述

pip install tensorflow==2.0 -i https://pypi.tuna.tsinghua.edu.cn/simple

Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐