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

昇腾计算产业是基于昇腾系列(HUAWEI Ascend)处理器和基础软件构建的全栈 AI计算基础设施、行业应用及服务,https://devpress.csdn.net/organization/setting/general/146749包括昇腾系列处理器、系列硬件、CANN、AI计算框架、应用使能、开发工具链、管理运维工具、行业应用及服务等全产业链

更多推荐