TypeError: expected bytes, Descriptor found

11,093

Try this, worked for me

pip install protobuf-py3
pip install --upgrade protobuf
Share:
11,093
ogzgrn
Author by

ogzgrn

Updated on June 04, 2022

Comments

  • ogzgrn
    ogzgrn almost 2 years

    How do I fix the following error traceback regarding tf.record?

    (tensorflow1) c:\tensorflow1\models\research\object_detection>python generate_tfrecord.py --csv_input=data/train_labels.csv --output_path=data/train.record --image_dir=(image directory)
    Traceback (most recent call last):
      File "generate_tfrecord.py", line 17, in <module>
        import tensorflow as tf
      File "C:\Users\Dell-Oguz\Anaconda3\envs\tensorflow1\lib\site-packages\tensorflow\__init__.py", line 24, in <module>
        from tensorflow.python import pywrap_tensorflow  # pylint: disable=unused-import
      File "C:\Users\Dell-Oguz\Anaconda3\envs\tensorflow1\lib\site-packages\tensorflow\python\__init__.py", line 52, in <module>
        from tensorflow.core.framework.graph_pb2 import *
      File "C:\Users\Dell-Oguz\Anaconda3\envs\tensorflow1\lib\site-packages\tensorflow\core\framework\graph_pb2.py", line 15, in <module>
        from tensorflow.core.framework import node_def_pb2 as tensorflow_dot_core_dot_framework_dot_node__def__pb2
      File "C:\Users\Dell-Oguz\Anaconda3\envs\tensorflow1\lib\site-packages\tensorflow\core\framework\node_def_pb2.py", line 15, in <module>
        from tensorflow.core.framework import attr_value_pb2 as tensorflow_dot_core_dot_framework_dot_attr__value__pb2
      File "C:\Users\Dell-Oguz\Anaconda3\envs\tensorflow1\lib\site-packages\tensorflow\core\framework\attr_value_pb2.py", line 15, in <module>
        from tensorflow.core.framework import tensor_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__pb2
      File "C:\Users\Dell-Oguz\Anaconda3\envs\tensorflow1\lib\site-packages\tensorflow\core\framework\tensor_pb2.py", line 15, in <module>
        from tensorflow.core.framework import resource_handle_pb2 as tensorflow_dot_core_dot_framework_dot_resource__handle__pb2
      File "C:\Users\Dell-Oguz\Anaconda3\envs\tensorflow1\lib\site-packages\tensorflow\core\framework\resource_handle_pb2.py", line 91, in <module>
        __module__ = 'tensorflow.core.framework.resource_handle_pb2'
    TypeError: expected bytes, Descriptor found
    
  • ogzgrn
    ogzgrn over 4 years
    Hi I did "conda uninstall -c anaconda tensorflow-gpu", then I run "conda install -c anaconda tensorflow-gpu" but I get same error. Could you give detail?
  • Mahmut Çakar
    Mahmut Çakar over 4 years
    Remove environment with conda remove --name myenv --all then create new environment conda create -n mynewenv python=3.6 . Then run activate mynewenv and conda install -c anaconda tensorflow-gpu
  • Mahmut Çakar
    Mahmut Çakar over 4 years
    I am not sure why it is not fixed. You can try install cuda, cudnn and keras step by step. Check below links. first install cuda; developer.nvidia.com/cuda-downloads (I recommend 10.0 or 10.1) docs.nvidia.com/deeplearning/sdk/cudnn-install/… after that try pip install tensorflow-gpu
  • Pushkaraj Joshi
    Pushkaraj Joshi over 3 years
    Worked for me but gave me another error. Referring to this answer to solve the problem I'm currently facing stackoverflow.com/questions/60423758/…