`$ python load_weights.py
Traceback (most recent call last):
File "load_weights.py", line 4, in
from yolov3_tf2.models import YoloV3, YoloV3Tiny
File "C:\Users\tmohamad\Desktop\yolov3_deepsort\yolov3_tf2\models.py", line 4, in
import tensorflow as tf
File "C:\Users\tmohamad\Miniconda3\envs\tracker-cpu\lib\site-packages\tensorflow__init.py", line 98, in
from tensorflow_core import *
File "C:\Users\tmohamad\Miniconda3\envs\tracker-cpu\lib\site-packages\tensorflow_core__init.py", line 40, in
from tensorflow.python.tools import module_util as _module_util
File "", line 983, in _find_and_load
File "", line 959, in _find_and_load_unlocked
File "C:\Users\tmohamad\Miniconda3\envs\tracker-cpu\lib\site-packages\tensorflow__init.py", line 50, in getattr__
module = self._load()
File "C:\Users\tmohamad\Miniconda3\envs\tracker-cpu\lib\site-packages\tensorflow\init__.py", line 44, in _load
module = _importlib.import_module(self.name)
File "C:\Users\tmohamad\Miniconda3\envs\tracker-cpu\lib\importlib__init__.py", line 127, in
import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "C:\Users\tmohamad\Miniconda3\envs\tracker-cpu\lib\site-packages\tensorflow_core\python__init__.py", line 52, in
from tensorflow.core.framework.graph_pb2 import *
File "C:\Users\tmohamad\Miniconda3\envs\tracker-cpu\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_nodedefpb2
File "C:\Users\tmohamad\Miniconda3\envs\tracker-cpu\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_attrvaluepb2
File "C:\Users\tmohamad\Miniconda3\envs\tracker-cpu\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_tensorpb2
File "C:\Users\tmohamad\Miniconda3\envs\tracker-cpu\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_resourcehandle__pb2
File "C:\Users\tmohamad\Miniconda3\envs\tracker-cpu\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_tensorshapepb2
File "C:\Users\tmohamad\Miniconda3\envs\tracker-cpu\lib\site-packages\tensorflow_core\core\framework\tensor_shape_pb2.py", line 42, in
serialized_options=None, file=DESCRIPTOR),
File "C:\Users\tmohamad\Miniconda3\envs\tracker-cpu\lib\site-packages\google\protobuf\descriptor.py", line 560, in new__
_message.Message._CheckCalledFromGeneratedFile()
TypeError: Descriptors cannot not be created directly.
If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0.
If you cannot immediately regenerate your protos, some other possible workarounds are:
Downgrade the protobuf package to 3.20.x or lower.
Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).
`$ python load_weights.py Traceback (most recent call last): File "load_weights.py", line 4, in
from yolov3_tf2.models import YoloV3, YoloV3Tiny
File "C:\Users\tmohamad\Desktop\yolov3_deepsort\yolov3_tf2\models.py", line 4, in
from tensorflow_core import *
File "C:\Users\tmohamad\Miniconda3\envs\tracker-cpu\lib\site-packages\tensorflow_core__init.py", line 40, in
from tensorflow.python.tools import module_util as _module_util
File "", line 983, in _find_and_load
File "", line 959, in _find_and_load_unlocked
File "C:\Users\tmohamad\Miniconda3\envs\tracker-cpu\lib\site-packages\tensorflow__init.py", line 50, in getattr__
module = self._load()
File "C:\Users\tmohamad\Miniconda3\envs\tracker-cpu\lib\site-packages\tensorflow\ init__.py", line 44, in _load
module = _importlib.import_module(self. name)
File "C:\Users\tmohamad\Miniconda3\envs\tracker-cpu\lib\importlib__init__.py", line 127, in
import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "C:\Users\tmohamad\Miniconda3\envs\tracker-cpu\lib\site-packages\tensorflow_core\python__init__.py", line 52, in
from tensorflow.core.framework.graph_pb2 import *
File "C:\Users\tmohamad\Miniconda3\envs\tracker-cpu\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 defpb2
File "C:\Users\tmohamad\Miniconda3\envs\tracker-cpu\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_attrvaluepb2
File "C:\Users\tmohamad\Miniconda3\envs\tracker-cpu\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_tensorpb2
File "C:\Users\tmohamad\Miniconda3\envs\tracker-cpu\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 "C:\Users\tmohamad\Miniconda3\envs\tracker-cpu\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 shapepb2
File "C:\Users\tmohamad\Miniconda3\envs\tracker-cpu\lib\site-packages\tensorflow_core\core\framework\tensor_shape_pb2.py", line 42, in
serialized_options=None, file=DESCRIPTOR),
File "C:\Users\tmohamad\Miniconda3\envs\tracker-cpu\lib\site-packages\google\protobuf\descriptor.py", line 560, in new__
_message.Message._CheckCalledFromGeneratedFile()
TypeError: Descriptors cannot not be created directly.
If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0.
If you cannot immediately regenerate your protos, some other possible workarounds are:
import tensorflow as tf File "C:\Users\tmohamad\Miniconda3\envs\tracker-cpu\lib\site-packages\tensorflow__init.py", line 98, in
More information: https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates`
solution: pip install protobuf==3.20.0