Models: 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

Created on 28 Nov 2019  路  10Comments  路  Source: tensorflow/models

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

awaiting response support

Most helpful comment

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

All 10 comments

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

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

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

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

from #From tensorflow/models/ run and check

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

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

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

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.

@simeon105

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

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

noumanriazkhan picture noumanriazkhan  路  3Comments

frankkloster picture frankkloster  路  3Comments

Mostafaghelich picture Mostafaghelich  路  3Comments

dsindex picture dsindex  路  3Comments

25b3nk picture 25b3nk  路  3Comments