models icon indicating copy to clipboard operation
models copied to clipboard

I am getting this error when I run : python generate_tfrecord.py --csv_input=images\train_labels.csv --image_dir=images\train --output_path=train.record

Open simeon105 opened this issue 7 years ago • 10 comments

Traceback (most recent call last): File "generate_tfrecord.py", line 17, in import tensorflow as tf File "E:\Anaconda\envs\tensorflow3\lib\site-packages\tensorflow_init_.py", line 24, in from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import File "E:\Anaconda\envs\tensorflow3\lib\site-packages\tensorflow\python_init_.py", line 59, in from tensorflow.core.framework.graph_pb2 import * File "E:\Anaconda\envs\tensorflow3\lib\site-packages\tensorflow\core\framework\graph_pb2.py", line 15, in from tensorflow.core.framework import node_def_pb2 as tensorflow_dot_core_dot_framework_dot_node__def__pb2 File "E:\Anaconda\envs\tensorflow3\lib\site-packages\tensorflow\core\framework\node_def_pb2.py", line 15, in from tensorflow.core.framework import attr_value_pb2 as tensorflow_dot_core_dot_framework_dot_attr__value__pb2 File "E:\Anaconda\envs\tensorflow3\lib\site-packages\tensorflow\core\framework\attr_value_pb2.py", line 15, in from tensorflow.core.framework import tensor_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__pb2 File "E:\Anaconda\envs\tensorflow3\lib\site-packages\tensorflow\core\framework\tensor_pb2.py", line 15, in from tensorflow.core.framework import resource_handle_pb2 as tensorflow_dot_core_dot_framework_dot_resource__handle__pb2 File "E:\Anaconda\envs\tensorflow3\lib\site-packages\tensorflow\core\framework\resource_handle_pb2.py", line 91, in module = 'tensorflow.core.framework.resource_handle_pb2' TypeError: expected bytes, Descriptor found

simeon105 avatar Nov 28 '19 12:11 simeon105

Thank you for your post. We noticed you have not filled out the following field in the issue template. Could you update them if they are relevant in your case, or leave them as N/A? Thanks. What is the top-level directory of the model you are using Have I written custom code OS Platform and Distribution TensorFlow installed from TensorFlow version Bazel version CUDA/cuDNN version GPU model and memory Exact command to reproduce

tensorflowbutler avatar Nov 29 '19 12:11 tensorflowbutler

tengo el mismo error tenia instalado tensorflow 1.14 y funcionaba correctamente pero al instalar con tensorflow 2.0 me arroja el mismo error Cuda 10 cuDNN 10 GPU GETforce 1050ti comando python generate_tfrecord.py --csv_input=images\train_labels.csv --image_dir=images\train --output_path=train.record error Traceback (most recent call last): File "generate_tfrecord.py", line 17, in import tensorflow as tf File "D:\Users\Cristian\Miniconda3\envs\tf\lib\site-packages\tensorflow_init_.py", line 98, in from tensorflow_core import * File "D:\Users\Cristian\Miniconda3\envs\tf\lib\site-packages\tensorflow_core_init_.py", line 40, in from tensorflow.python.tools import module_util as _module_util File "", line 968, in _find_and_load File "", line 949, in find_and_load_unlocked File "D:\Users\Cristian\Miniconda3\envs\tf\lib\site-packages\tensorflow_init.py", line 50, in getattr module = self.load() File "D:\Users\Cristian\Miniconda3\envs\tf\lib\site-packages\tensorflow_init.py", line 44, in _load module = importlib.import_module(self.name) File "D:\Users\Cristian\Miniconda3\envs\tf\lib\importlib_init.py", line 126, in import_module return _bootstrap.gcd_import(name[level:], package, level) File "D:\Users\Cristian\Miniconda3\envs\tf\lib\site-packages\tensorflow_core\python_init.py", line 52, in from tensorflow.core.framework.graph_pb2 import * File "D:\Users\Cristian\Miniconda3\envs\tf\lib\site-packages\tensorflow_core\core\framework\graph_pb2.py", line 16, in from tensorflow.core.framework import node_def_pb2 as tensorflow_dot_core_dot_framework_dot_node__def__pb2 File "D:\Users\Cristian\Miniconda3\envs\tf\lib\site-packages\tensorflow_core\core\framework\node_def_pb2.py", line 16, in from tensorflow.core.framework import attr_value_pb2 as tensorflow_dot_core_dot_framework_dot_attr__value__pb2 File "D:\Users\Cristian\Miniconda3\envs\tf\lib\site-packages\tensorflow_core\core\framework\attr_value_pb2.py", line 16, in from tensorflow.core.framework import tensor_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__pb2 File "D:\Users\Cristian\Miniconda3\envs\tf\lib\site-packages\tensorflow_core\core\framework\tensor_pb2.py", line 16, in from tensorflow.core.framework import resource_handle_pb2 as tensorflow_dot_core_dot_framework_dot_resource__handle__pb2 File "D:\Users\Cristian\Miniconda3\envs\tf\lib\site-packages\tensorflow_core\core\framework\resource_handle_pb2.py", line 16, in from tensorflow.core.framework import tensor_shape_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__shape__pb2 File "D:\Users\Cristian\Miniconda3\envs\tf\lib\site-packages\tensorflow_core\core\framework\tensor_shape_pb2.py", line 112, in 'module' : 'tensorflow.core.framework.tensor_shape_pb2' TypeError: expected bytes, Descriptor found

kriz232121 avatar Dec 04 '19 03:12 kriz232121

Remove existing environment and create a new one. Then run conda install -c anaconda tensorflow-gpu .

thecaffeinedev avatar Dec 07 '19 07:12 thecaffeinedev

File "generate_tfrecord.py", line 17, in import tensorflow as tf File "C:\Users\Thiyananthan Thinesh\Anaconda3\envs\tf1.12\lib\site-packages\tensorflow_init_.py", line 24, in from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import File "C:\Users\Thiyananthan Thinesh\Anaconda3\envs\tf1.12\lib\site-packages\tensorflow\python_init_.py", line 59, in from tensorflow.core.framework.graph_pb2 import * File "C:\Users\Thiyananthan Thinesh\Anaconda3\envs\tf1.12\lib\site-packages\tensorflow\core\framework\graph_pb2.py", line 15, in from tensorflow.core.framework import node_def_pb2 as tensorflow_dot_core_dot_framework_dot_node__def__pb2 File "C:\Users\Thiyananthan Thinesh\Anaconda3\envs\tf1.12\lib\site-packages\tensorflow\core\framework\node_def_pb2.py", line 15, in from tensorflow.core.framework import attr_value_pb2 as tensorflow_dot_core_dot_framework_dot_attr__value__pb2 File "C:\Users\Thiyananthan Thinesh\Anaconda3\envs\tf1.12\lib\site-packages\tensorflow\core\framework\attr_value_pb2.py", line 15, in from tensorflow.core.framework import tensor_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__pb2 File "C:\Users\Thiyananthan Thinesh\Anaconda3\envs\tf1.12\lib\site-packages\tensorflow\core\framework\tensor_pb2.py", line 15, in from tensorflow.core.framework import resource_handle_pb2 as tensorflow_dot_core_dot_framework_dot_resource__handle__pb2 File "C:\Users\Thiyananthan Thinesh\Anaconda3\envs\tf1.12\lib\site-packages\tensorflow\core\framework\resource_handle_pb2.py", line 91, in module = 'tensorflow.core.framework.resource_handle_pb2' TypeError: expected bytes, Descriptor found

same problem

tthinesh avatar Dec 11 '19 04:12 tthinesh

from #From tensorflow/models/ run and check

protoc object_detection/protos/*.proto --python_out=.

thecaffeinedev avatar Dec 11 '19 07:12 thecaffeinedev

me sirvió crear un nuevo ambiente virtual en el cual instale mediante el comando conda install -c anaconda tensorflow-gpu=1.14 porque estaba trabajando anteriormente con esa versión gracias TheCaffeineDev

kriz232121 avatar Dec 12 '19 11:12 kriz232121

Please run "conda install -c anaconda protobuf" command on your env and post output.

maacofficial avatar Mar 19 '20 11:03 maacofficial

Traceback (most recent call last): File "generate_tfrecord.py", line 17, in import tensorflow as tf File "E:\Anaconda\envs\tensorflow3\lib\site-packages\tensorflow__init__.py", line 24, in from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import File "E:\Anaconda\envs\tensorflow3\lib\site-packages\tensorflow\python__init__.py", line 59, in from tensorflow.core.framework.graph_pb2 import * File "E:\Anaconda\envs\tensorflow3\lib\site-packages\tensorflow\core\framework\graph_pb2.py", line 15, in from tensorflow.core.framework import node_def_pb2 as tensorflow_dot_core_dot_framework_dot_node__def__pb2 File "E:\Anaconda\envs\tensorflow3\lib\site-packages\tensorflow\core\framework\node_def_pb2.py", line 15, in from tensorflow.core.framework import attr_value_pb2 as tensorflow_dot_core_dot_framework_dot_attr__value__pb2 File "E:\Anaconda\envs\tensorflow3\lib\site-packages\tensorflow\core\framework\attr_value_pb2.py", line 15, in from tensorflow.core.framework import tensor_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__pb2 File "E:\Anaconda\envs\tensorflow3\lib\site-packages\tensorflow\core\framework\tensor_pb2.py", line 15, in from tensorflow.core.framework import resource_handle_pb2 as tensorflow_dot_core_dot_framework_dot_resource__handle__pb2 File "E:\Anaconda\envs\tensorflow3\lib\site-packages\tensorflow\core\framework\resource_handle_pb2.py", line 91, in module = 'tensorflow.core.framework.resource_handle_pb2' TypeError: expected bytes, Descriptor found

Please run "conda install -c anaconda protobuf" command on your env and post output.

maacofficial avatar Mar 19 '20 11:03 maacofficial

@simeon105

Please, let us know which pretrained model you are using and share related code .Thanks!

ravikyram avatar Jun 19 '20 07:06 ravikyram

Automatically closing due to lack of recent activity. Please update the issue when new information becomes available, and we will reopen the issue. Thanks!

ravikyram avatar Jul 14 '20 09:07 ravikyram