22
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

ModuleNotFoundError: No module named 'tensorflow.contrib'が出た時の対処法

Posted at

#環境
python3.7.6
MacOS Mojave

#問題
以下のエラーがでる。

ModuleNotFoundError: No module named 'tensorflow.contrib'

#考えらえる理由
tensorflowのバージョンが高いことが原因の可能性が高いです。

#対処法
以下の方法でtensorflowのダウングレードができます。

terminal
$pip install tensorflow==1.14

#その他
以下のエラーの場合も同様の原因である可能性があるので、もし出てきたら上の対処法を試してみてください。

AttributeError: module 'tensorflow' has no attribute 'contrib' 
AttributeError: module 'tensorflow' has no attribute 'placeholder'
AttributeError: module 'tensorflow' has no attribute 'Variable'

#最後に
tensorflowの仕様変わりすぎじゃないですか、、、辛い。
自分の失敗が誰かのお役に立てたら幸いです。

22
8
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
22
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?