You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ImportError: No module named core.framework.graph_pb2 #61
Compiled tensorflow from source, everything works including the eigen value computation example. However, when I try to run the mnist convolutional net example with the command 'python tensorflow/models/image/mnist/convolutional.py' I get the error: ImportError: No module named core.framework.graph_pb2.
If you've already installed the package, there might be some PYTHONPATH confusion due to your current working directory containing a directory called "tensorflow" without all of the generated protobuf files. One solution would be to cd into tensorflow/models/image/mnist and run python ./convolutional,py from there.
The suggested solution is to "install the PIP package:.
I have done this but I still get this error.
This statement is a little confusing ...
"PYTHONPATH confusion due to your current working directory containing a directory called "tensorflow" without all of the generated protobuf files."
... because there are no .proto files in any tensorflow directory:
I tried the suggested work-around
"cd into tensorflow/models/image/mnist and run python ./convolutional,py from there."
This still gives me the error ...
$python convolutional.py
Traceback (most recent call last):
File "convolutional.py", line 13, in
import tensorflow.python.platform
File "/Users/alexryan/projects/machineLearning/tensorFlow/clone/tensorflow/tensorflow/init.py", line 4, in
from tensorflow.python import *
File "/Users/alexryan/projects/machineLearning/tensorFlow/clone/tensorflow/tensorflow/python/init.py", line 13, in
from tensorflow.core.framework.graph_pb2 import *
ImportError: No module named core.framework.graph_pb2
A solution to this would be very much appreciated.
@alexryan: It looks like the TensorFlow Python code is being loaded from the directory /Users/alexryan/projects/machineLearning/tensorFlow/clone/tensorflow/, which is an unusual path for the PIP installer to use. Did you also clone the git repository and add that directory to your PATH or PYTHONPATH environment variables? If so, try removing it - the problem arises because it tries to load from the unbuilt project source, which doesn't include the generated code for the protocol buffers (e.g. graph_pb2.py). If you have also installed it using PIP, it should be in your path already.
thank you.
yes, I cloned the git repository to get access to the tutorial code.
I had set the PYTHONPATH environment variable to include the tutorial code because I was getting this error:
$python fully_connected_feed.py
Traceback (most recent call last):
File "fully_connected_feed.py", line 19, in
from tensorflow.g3doc.tutorials.mnist import input_data
ImportError: No module named g3doc.tutorials.mnist
The tutorial source included these statements:
#from tensorflow.g3doc.tutorials.mnist import input_data
#from tensorflow.g3doc.tutorials.mnist import mnist
It seems like python is trying to find these files in a different tensorflow directory.
Changing the tutorial source to this solved the problem.
import input_data
import mnist
Activity
mrry commentedon Nov 10, 2015
For this to work, you'll have to install the PIP package. You can either download the pre-built package, or build it from source by following the instructions here: http://tensorflow.org/get_started/os_setup.md#create-pip
If you've already installed the package, there might be some PYTHONPATH confusion due to your current working directory containing a directory called "tensorflow" without all of the generated protobuf files. One solution would be to
cdintotensorflow/models/image/mnistand runpython ./convolutional,pyfrom there.vrv commentedon Nov 10, 2015
Yeah, this might be yet another instance of #51
Given how often this is happening, I wonder if there's a better solution ...
alexryan commentedon Nov 11, 2015
The suggested solution is to "install the PIP package:.
I have done this but I still get this error.
This statement is a little confusing ...
"PYTHONPATH confusion due to your current working directory containing a directory called "tensorflow" without all of the generated protobuf files."
... because there are no .proto files in any tensorflow directory:
$find . -name '*.proto'
./tensorflow/core/example/example.proto
./tensorflow/core/example/feature.proto
./tensorflow/core/framework/allocation_description.proto
./tensorflow/core/framework/attr_value.proto
./tensorflow/core/framework/config.proto
./tensorflow/core/framework/device_attributes.proto
./tensorflow/core/framework/function.proto
./tensorflow/core/framework/graph.proto
./tensorflow/core/framework/kernel_def.proto
./tensorflow/core/framework/op_def.proto
./tensorflow/core/framework/step_stats.proto
./tensorflow/core/framework/summary.proto
./tensorflow/core/framework/tensor.proto
./tensorflow/core/framework/tensor_description.proto
./tensorflow/core/framework/tensor_shape.proto
./tensorflow/core/framework/tensor_slice.proto
./tensorflow/core/framework/types.proto
./tensorflow/core/kernels/reader_base.proto
./tensorflow/core/lib/core/error_codes.proto
./tensorflow/core/util/event.proto
./tensorflow/core/util/saved_tensor_slice.proto
./tensorflow/python/training/checkpoint_state.proto
./tensorflow/python/training/saver.proto
./tensorflow/python/util/protobuf/compare_test.proto
I tried the suggested work-around
"cd into tensorflow/models/image/mnist and run python ./convolutional,py from there."
This still gives me the error ...
$python convolutional.py
Traceback (most recent call last):
File "convolutional.py", line 13, in
import tensorflow.python.platform
File "/Users/alexryan/projects/machineLearning/tensorFlow/clone/tensorflow/tensorflow/init.py", line 4, in
from tensorflow.python import *
File "/Users/alexryan/projects/machineLearning/tensorFlow/clone/tensorflow/tensorflow/python/init.py", line 13, in
from tensorflow.core.framework.graph_pb2 import *
ImportError: No module named core.framework.graph_pb2
A solution to this would be very much appreciated.
mrry commentedon Nov 11, 2015
@alexryan: It looks like the TensorFlow Python code is being loaded from the directory
/Users/alexryan/projects/machineLearning/tensorFlow/clone/tensorflow/, which is an unusual path for the PIP installer to use. Did you also clone the git repository and add that directory to your PATH or PYTHONPATH environment variables? If so, try removing it - the problem arises because it tries to load from the unbuilt project source, which doesn't include the generated code for the protocol buffers (e.g. graph_pb2.py). If you have also installed it using PIP, it should be in your path already.alexryan commentedon Nov 11, 2015
thank you.
yes, I cloned the git repository to get access to the tutorial code.
I had set the PYTHONPATH environment variable to include the tutorial code because I was getting this error:
$python fully_connected_feed.py
Traceback (most recent call last):
File "fully_connected_feed.py", line 19, in
from tensorflow.g3doc.tutorials.mnist import input_data
ImportError: No module named g3doc.tutorials.mnist
The tutorial source included these statements:
#from tensorflow.g3doc.tutorials.mnist import input_data
#from tensorflow.g3doc.tutorials.mnist import mnist
It seems like python is trying to find these files in a different tensorflow directory.
Changing the tutorial source to this solved the problem.
import input_data
import mnist
Merge pull request tensorflow#62 from terrytangyuan/early-stopping
Register batch normalization kernels for OpenCL (#61)
Register batch normalization kernels for OpenCL (#61)
Register batch normalization kernels for OpenCL (#61)
Register batch normalization kernels for OpenCL (#61)
[OpenCL] Implementation improvements (#9117)
[OpenCL] Registers ApplyRMSProp and ApplyCenteredRMSProp (tensorflow#61)
Merge pull request tensorflow#61 from lissyx/merge-master-20180312
[spirv] Add binary logical operations.
Add security advisory for vuln #61 in 2022