ImportError: cannot import name 'abs' 導入tensorflow報錯

解決 ImportError: cannot import name ‘abs’ 導入tensorflow報錯

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

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章