Я использую API-интерфейс определения объектов tenorflow. Я не могу найти никакого решения для этого. Пожалуйста, помогите мне.
мой код
MODEL_NAME = 'inference_graph'
PATH_TO_FROZEN_GRAPH = MODEL_NAME + '/frozen_inference_graph.pb'
PATH_TO_LABELS = 'training/labelmap.pbtxt'
detection_graph = tf.Graph()
with detection_graph.as_default():
od_graph_def = tf.GraphDef()
with tf.gfile.GFile(PATH_TO_FROZEN_GRAPH, 'rb') as fid:
serialized_graph = fid.read()
od_graph_def.ParseFromString(serialized_graph)
tf.import_graph_def(od_graph_def, name='')
Отображается ошибка
<ipython-input-10-d55b98fd5a78> in <module>
3 od_graph_def = tf.GraphDef()
4 with tf.gfile.GFile(PATH_TO_FROZEN_GRAPH, 'rb') as fid:
----> 5 serialized_graph = fid.read()
6 od_graph_def.ParseFromString(serialized_graph)
7 tf.import_graph_def(od_graph_def, name='')
~\Anaconda3\lib\site-packages\tensorflow\python\lib\io\file_io.py in
read(self, n)
123 string if in string (regular) mode.
124 """
--> 125 self._preread_check()
126 with errors.raise_exception_on_not_ok_status() as status:
127 if n == -1:
~\Anaconda3\lib\site-packages\tensorflow\python\lib\io\file_io.py in
_preread_check(self)
83 with errors.raise_exception_on_not_ok_status() as status:
84 self._read_buf = pywrap_tensorflow.CreateBufferedInputStream(
---> 85 compat.as_bytes(self.__name), 1024 * 512, status)
86
87 def _prewrite_check(self):
~\Anaconda3\lib\site-packages\tensorflow\python\framework\errors_impl.py
in __exit__(self, type_arg, value_arg, traceback_arg)
526 None, None,
527 compat.as_text(c_api.TF_Message(self.status.status)),
--> 528 c_api.TF_GetCode(self.status.status))
529 # Delete the underlying status object from memory otherwise it
stays alive
530 # as there is a reference to status from this from the traceback
due to
NotFoundError: NewRandomAccessFile failed to Create/Open:
inference_graph/frozen_inference_graph.pb : The system cannot find the
path specified.
; No such process
каталог файла существует в inference_graph / frozen_inference_graph.pb, но почему возникает эта ошибка?