升級(jí)tensorflow后,出現(xiàn)報(bào)錯(cuò)信息:ImportError: No module named protobuf
爬迟。
>>> from tensorflow.examples.tutorials.mnist import input_data
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/Chris/HappyCoding/tensorflow/lib/python2.7/site-packages/tensorflow/__init__.py", line 24, in <module>
from tensorflow.python import *
File "/Users/Chris/HappyCoding/tensorflow/lib/python2.7/site-packages/tensorflow/python/__init__.py", line 52, in <module>
from tensorflow.core.framework.graph_pb2 import *
File "/Users/Chris/HappyCoding/tensorflow/lib/python2.7/site-packages/tensorflow/core/framework/graph_pb2.py", line 6, in <module>
from google.protobuf import descriptor as _descriptor
ImportError: No module named protobuf
臨時(shí)解決辦法:卸載 tensorflow剩瓶,重新安裝
pip uninstall tensorflow
pip uninstall protobuf
pip uninstall google
pip install ~/Downloads/tensorflow-1.4.0-py2-none-any.whl