1
5

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 5 years have passed since last update.

tensorflow r1.4 で Error: No module named 'tensorflow.contrib.quantize' となる時の対処法

Last updated at Posted at 2018-01-16

モジュールが無いと言われる時の、確認方法と対処法。
ModuleNotFoundError: No module named 'tensorflow.contrib.quantize'

参考:【Python】インストールしたはずのMuduleが「No module named '***'」になったときの解決策

モジュールのありかを確認する

finderか何かで確認すると、
おそらくtensorflow/tensorflow/contrib/quantize
とあると思うが、実はそれ、pythonが見に行ってる場所と違うらしい。

$ python
でpythonのコマンドラインに入って

python
>>>import tensorflow
>>>print(tensorflow.__file__)

と一行ずつ打つと
/usr/lib/python3.2/site-packages/tensorflow/__init__.py
こんな感じで返ってくる。

移動すると
$ cd usr/lib/python3.2/site-packages/tensorflow/contrib
quantizeないじゃん!!!!!

#モジュールの場所を移動

というわけで、
tensorflow/tensorflow/contrib/quantize
から
usr/lib/python3.2/site-packages/tensorflow/contrib/ココ
にコピペで移動させる。

usr/lib/python3.2/site-packages/tensorflow/contrib/quantize
となればOK。

1
5
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
1
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?