ImportError: no module named core.framework.graph_pb2

When I follow the installation for linux from the fiforflow offical site , everything will be fine until the last step: Configure your first TensorFlow neural network model .

When I execute the command python tensorflow/models/image/mnist/convolutional.py, "Import Empire".

Traceback (most recent call last):
  File "tensorflow/models/image/mnist/convolutional.py", line 13, in <module>
    import tensorflow.python.platform
  File "/home/guo/haplox/Github/tensorflow/tensorflow/__init__.py", line 4, in <module>
    from tensorflow.python import *
  File "/home/guo/haplox/Github/tensorflow/tensorflow/python/__init__.py", line 13, in <module>
    from tensorflow.core.framework.graph_pb2 import *
ImportError: No module named core.framework.graph_pb2

My OS is 14.04.1-Ubuntu.

+4
source share
6 answers

I met exactly the same problem. once you have successfully installed shadoworflow, it is no longer related to the library dependency.

if you executed convolution.py 100% exactly as manually and get an exception as shown below

ImportError: No module named core.framework.graph_b2

, python script , , root "src".

src$python tensorflow/models/image/mnist/convolutional.py

script . , shadoworflow src dir, , xxx, .

xxx$python src/tensorflow/models/image/mnist/convolutional.py

bingo, !

+6

, :

+2

, v2.6.

TensorFlow v3.0, / TensorFlow. , .

+2
source

I solved this using virtualenv, but there are many other factors that can cause the same error.

Additional solutions in Github solutions # 81 , # 61 , # 51 .

+1
source

For me, the solution was to run with python3 instead of python

+1
source

The error is still being requested after installing / updating 6 on OS X 10.9.5:

    >>> import tensorflow as tf
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "tensorflow/__init__.py", line 4, in <module>
    from tensorflow.python import *
  File "tensorflow/python/__init__.py", line 13, in <module>
    from tensorflow.core.framework.graph_pb2 import *
ImportError: No module named core.framework.graph_pb2
0
source

Source: https://habr.com/ru/post/1615191/


All Articles