安装tensorflow过程中的报错

①安装tensorflow后,测试安装是否成功,结果报错:


SystemError: returned a result with an error set

安装tensorflow过程中的报错_第1张图片

 原因:安装tensorflow时没有选择版本(我是输入pip install tensorflow安装的),系统默认安装最新版本2.8,而python版本为3.7,不兼容导致,tensorflow与python版本要对应
解决办法:对tensorflow降级重新安装(pip install tensorflow-GPU==2.5),安装2.5版本的tensorflow,

②安装过程中遇到新报错:
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
cryptography 3.3.2 requires cffi>=1.12, but you have cffi 1.11.5 which is incompatible.

百度一下,安装joblib(pip install joblib)和scikit-learn(pip install scikit-learn)后重新安装tensorflow成功

安装tensorflow过程中的报错_第2张图片

 

③在Jupyter运行代码时又报错:
module 'keras.engine.base_layer' has no attribute 'BaseRandomLayer'
module 'tensorflow.compat.v2.__internal__.tracking' has no attribute 'no_automatic_dependency_tracking'

重新将tensorflow降级到2.0,keras降级到2.3,tensorflow与keras版本也要对应

④打开anaconda-jupyter运行代码,居然报错找不到包,原因是anaconda不同环境不共享包,
打开cmd,输入jupyter notebook运行,代码运行正常!

你可能感兴趣的:(python,tensorflow,keras,python,jupyter)