OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

ImportError: cannot import name 'runtime_version' from 'google.protobuf'

  • Thread starter Thread starter varda
  • Start date Start date
V

varda

Guest
Code:
PS D:\RealTimeObjectDetection> python Tensorflow/models/research/object_detection/model_main_tf2.py --model_dir=Tensorflow/workspace/models/my_ssd_mobnet --pipeline_config_path=Tensorflow/workspace/models/my_ssd_mobnet/pipeline.config --num_train_steps=10000
Traceback (most recent call last):
  File "D:\RealTimeObjectDetection\Tensorflow\models\research\object_detection\model_main_tf2.py", line 31, in <module>
    import model_lib_v2
  File "D:\RealTimeObjectDetection\Tensorflow\models\research\object_detection\model_lib_v2.py", line 29, in <module>
    import eval_util
  File "D:\RealTimeObjectDetection\Tensorflow\models\research\object_detection\eval_util.py", line 35, in <module>
    from object_detection.metrics import coco_evaluation
  File "D:\RealTimeObjectDetection\Tensorflow\models\research\object_detection\metrics\coco_evaluation.py", line 28, in <module>
    from object_detection.utils import object_detection_evaluation
  File "D:\RealTimeObjectDetection\Tensorflow\models\research\object_detection\utils\object_detection_evaluation.py", line 46, in <module>
    from object_detection.utils import label_map_util
  File "D:\RealTimeObjectDetection\Tensorflow\models\research\object_detection\utils\label_map_util.py", line 29, in <module>
    from object_detection.protos import string_int_label_map_pb2
  File "D:\RealTimeObjectDetection\Tensorflow\models\research\object_detection\protos\string_int_label_map_pb2.py", line 9, in <module>
    from google.protobuf import runtime_version as _runtime_version
ImportError: cannot import name 'runtime_version' from 'google.protobuf' (C:\Users\varda\AppData\Local\Programs\Python\Python311\Lib\site-packages\google\protobuf\__init__.py)

Is it a version error? also I tried to set a PYTHONPATH variable in User variables but the compiler is still looking into site-packages for object_detection file, whereas I set the path to a different location in D drive
<pre><code>PS D:\RealTimeObjectDetection> python Tensorflow/models/research/object_detection/model_main_tf2.py --model_dir=Tensorflow/workspace/models/my_ssd_mobnet --pipeline_config_path=Tensorflow/workspace/models/my_ssd_mobnet/pipeline.config --num_train_steps=10000
Traceback (most recent call last):
File "D:\RealTimeObjectDetection\Tensorflow\models\research\object_detection\model_main_tf2.py", line 31, in <module>
import model_lib_v2
File "D:\RealTimeObjectDetection\Tensorflow\models\research\object_detection\model_lib_v2.py", line 29, in <module>
import eval_util
File "D:\RealTimeObjectDetection\Tensorflow\models\research\object_detection\eval_util.py", line 35, in <module>
from object_detection.metrics import coco_evaluation
File "D:\RealTimeObjectDetection\Tensorflow\models\research\object_detection\metrics\coco_evaluation.py", line 28, in <module>
from object_detection.utils import object_detection_evaluation
File "D:\RealTimeObjectDetection\Tensorflow\models\research\object_detection\utils\object_detection_evaluation.py", line 46, in <module>
from object_detection.utils import label_map_util
File "D:\RealTimeObjectDetection\Tensorflow\models\research\object_detection\utils\label_map_util.py", line 29, in <module>
from object_detection.protos import string_int_label_map_pb2
File "D:\RealTimeObjectDetection\Tensorflow\models\research\object_detection\protos\string_int_label_map_pb2.py", line 9, in <module>
from google.protobuf import runtime_version as _runtime_version
ImportError: cannot import name 'runtime_version' from 'google.protobuf' (C:\Users\varda\AppData\Local\Programs\Python\Python311\Lib\site-packages\google\protobuf\__init__.py)
</code></pre>
<p>Is it a version error? also I tried to set a PYTHONPATH variable in User variables but the compiler is still looking into site-packages for object_detection file, whereas I set the path to a different location in D drive</p>
 
Top