简体   繁体   English

尝试运行 tensorflow 示例代码时包不兼容

[英]incompatible packages when trying to run tensorflow example code

I'm trying to run some example code found on keras .我正在尝试运行在keras上找到的一些示例代码。 When I run import tensorflow , I get an error当我运行import tensorflow时,出现错误

RuntimeError: module compiled against API version 0xe but this version of numpy is 0xd

Then when I import pandas , I get the error然后当我import pandas时,我得到了错误

ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 88 from C header, got 80 from PyObject

According to this post , there is some incompatibility between the pandas, numpy, and tensorflow packages.根据这篇文章,pandas、numpy 和 tensorflow 封装之间存在一些不兼容。 I tried some of the suggestions in that post like installing specific versions of pandas and numpy, but I still get errors.我尝试了该帖子中的一些建议,例如安装特定版本的 pandas 和 numpy,但我仍然遇到错误。 (I'm using WinPython 64 bit v.3.9.4.0) Any suggestions? (我使用的是 WinPython 64 位 v.3.9.4.0)有什么建议吗?

Note: I have packages numpy 1.19.5 , pandas 1.2.4 , tensorflow 2.5.0 .注意:我有包numpy 1.19.5pandas 1.2.4tensorflow 2.5.0

When you install a package, the dependencies are automatically installed with the good version.当您安装 package 时,会自动安装好版本的依赖项。 I recommend you to uninstall all of these libraries and then run pip install tensorflow .我建议您卸载所有这些库,然后运行pip install tensorflow It will install the correct version of numpy.它将安装正确版本的 numpy。 Then install the latest version of pandas with pip install pandas .然后安装最新版本的 pandas 和pip install pandas

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 尝试运行我的 tensorflow 代码时出错 - error when trying to run my tensorflow code Tensorflow Keras 修改虹膜示例时形状不兼容 - Tensorflow Keras Incompatible shapes when modifying Iris example 尝试在 Android 工作室中实现 tensorflow lite model 时,我收到不兼容的数据类型错误 - When trying to implement tensorflow lite model in Android studio I am getting an incompatible data types error 尝试从lib运行示例时出现pyPDF2 TypeError - pyPDF2 TypeError when trying to run example from lib 尝试运行TensorFlow时CUDNN_STATUS_NOT_INITIALIZED - CUDNN_STATUS_NOT_INITIALIZED when trying to run TensorFlow 尝试运行 tensorflow model 训练脚本时出现 Zsh 错误 - Zsh error when trying to run tensorflow model training script Tensorflow 使用 GradientTape 时矩阵大小不兼容 - Tensorflow incompatible matrix size when using GradientTape 在 Tensorflow (None, 1) 和 (None, 150) 中拟合我的 CNN 时形状不兼容,即使在尝试 One-Hot Encoding 之后也是如此 - Incompatible shapes when fitting my CNN in Tensorflow (None, 1) and (None, 150) even after trying One-Hot Encoding 尝试运行基于 PysimpleGUIqt 的代码时出错 - Error when trying to run code based on PysimpleGUIqt 尝试运行pdfquery示例时出错 - Error trying to run pdfquery example
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM