系统:
Windows、python3.6、Anaconda版本、CPU版本TensorFlow 1.12
有图有真相:
报错:
from tensorflow.python.keras._impl.keras.backend import abs
ImportError: cannot import name 'abs'
原因:
版本不匹配
解决办法:
It seems to be a problem if there is a previous installation of tensorflow available. These steps seems to solve the problem.
1) uninstalling tensorflow 2) uninstalling protobuf 3) reinstalling tensorflow (which should come along with the correct protobuf version.
Also need to go to
C:\Program Files (x86)\Microsoft Visual Studio\Shared\Anaconda3_64\Lib\site-packages
and delete all tensorflow related folders
Source : https://github.com/tensorflow/tensorflow/issues/20778