import tensorflow出错:

from tensorflow.python.keras._impl.keras.backend import abs 
ImportError: cannot import name 'abs'

解决方案:参考

pip uninstall tensorflow protobuf --yes
find $CONDA_PREFIX -name "tensorflow" | xargs -Ipkg rm -rfv pkg
pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.9.0-cp36-cp36m-linux_x86_64.whl --no-cache-dir

后面安装tensorflow我改成了安装1.8.0版本,这个可以根据自己需要安装不同版本。
在这里插入图片描述
安装过程中出现两个问题:以下图片红色字体部分
在这里插入图片描述

问题1:distributed 1.21.8 requires msgpack, which is not installed.
解决:pip3 install msgpack
问题2:tensorflow-tensorboard 0.4.0 has requirement bleach==1.5.0, but you'll have bleach 3.0.2 which is incompatible.
解决:pip3 uninstall bleachpip3 install bleach==1.5.0
在这里插入图片描述
最后import tensorflow成功!!

Logo

AtomGit 是由开放原子开源基金会联合 CSDN 等生态伙伴共同推出的新一代开源与人工智能协作平台。平台坚持“开放、中立、公益”的理念,把代码托管、模型共享、数据集托管、智能体开发体验和算力服务整合在一起,为开发者提供从开发、训练到部署的一站式体验。

更多推荐