python3導入tensorflow時import tensorflow報錯如下:
ImportError: cannot import name ‘abs’
原因:
protobuf和tensorflow發生了衝突
解決方法:
刪除tensorflow所有模塊(包括-gpu)
pip uninstall tensorflow
1
刪除protobuf
pip uninstall protobuf
1
重新安裝tensorflow
pip install tensorflow==1.8.0
1
Reference:
https://stackoverflow.com/questions/51299194/importerror-cannot-import-name-abs