thtrieu / darkflow

Translate darknet to tensorflow. Load trained weights, retrain/fine-tune using tensorflow, export constant graph def to mobile devices
GNU General Public License v3.0
6.13k stars 2.08k forks source link

tensorflow.python.framework.errors_impl.NotFoundError: NewRandomAccessFile failed to Create/Open: built_graph/tiny-yolo-voc-52c.pb #1130

Closed Mikkochu closed 4 years ago

Mikkochu commented 4 years ago

Currently I have two files in build/graph folder: tiny-yolo-voc-52c.meta tiny-yolo-voc-52c.pb

I'm trying to run the following script

import cv2  #Open Source Computer Vision is a library which helps in real-time computer vision and used for Image Processing
from darkflow.net.build import TFNet     #Tfnet is a class in build.py python files through which  Translate darknet to tensorflow.
import matplotlib.pyplot as plt          #it is used for data visualization

#%config InlineBackend.figure_format = 'svg'

# define the model options and run

# Training the model
# define the model options and run
#This step involves training your model based on dataset and labels you generated*

options = {
    'metaLoad':"built_graph/tiny-yolo-voc-52c.meta",
    'pbLoad':"built_graph/tiny-yolo-voc-52c.pb",
    'threshold': 0.07,
    'cpu': 1.0

     }
tfnet = TFNet(options)

I don't understand the error What can I do to fix it?

C:\Users\Mikko\PycharmProjects\Darknet_project\venv\Scripts\python.exe C:/Users/Mikko/PycharmProjects/Darknet_project/Main.py
C:\Users\Mikko\PycharmProjects\Darknet_project\venv\lib\site-packages\tensorflow\python\framework\dtypes.py:526: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint8 = np.dtype([("qint8", np.int8, 1)])
C:\Users\Mikko\PycharmProjects\Darknet_project\venv\lib\site-packages\tensorflow\python\framework\dtypes.py:527: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_quint8 = np.dtype([("quint8", np.uint8, 1)])
C:\Users\Mikko\PycharmProjects\Darknet_project\venv\lib\site-packages\tensorflow\python\framework\dtypes.py:528: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint16 = np.dtype([("qint16", np.int16, 1)])
C:\Users\Mikko\PycharmProjects\Darknet_project\venv\lib\site-packages\tensorflow\python\framework\dtypes.py:529: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_quint16 = np.dtype([("quint16", np.uint16, 1)])
C:\Users\Mikko\PycharmProjects\Darknet_project\venv\lib\site-packages\tensorflow\python\framework\dtypes.py:530: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint32 = np.dtype([("qint32", np.int32, 1)])
C:\Users\Mikko\PycharmProjects\Darknet_project\venv\lib\site-packages\tensorflow\python\framework\dtypes.py:535: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  np_resource = np.dtype([("resource", np.ubyte, 1)])

Loading from .pb and .meta
WARNING:tensorflow:From C:\Users\Mikko\PycharmProjects\Darknet_project\darkflow-master\darkflow\net\build.py:82: FastGFile.__init__ (from tensorflow.python.platform.gfile) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.gfile.GFile.
Traceback (most recent call last):
  File "C:/Users/Mikko/PycharmProjects/Darknet_project/Main.py", line 22, in <module>
    tfnet = TFNet(options)
  File "C:\Users\Mikko\PycharmProjects\Darknet_project\darkflow-master\darkflow\net\build.py", line 55, in __init__
    self.build_from_pb()
  File "C:\Users\Mikko\PycharmProjects\Darknet_project\darkflow-master\darkflow\net\build.py", line 84, in build_from_pb
    graph_def.ParseFromString(f.read())
  File "C:\Users\Mikko\PycharmProjects\Darknet_project\venv\lib\site-packages\tensorflow\python\lib\io\file_io.py", line 125, in read
    self._preread_check()
  File "C:\Users\Mikko\PycharmProjects\Darknet_project\venv\lib\site-packages\tensorflow\python\lib\io\file_io.py", line 85, in _preread_check
    compat.as_bytes(self.__name), 1024 * 512, status)
  File "C:\Users\Mikko\PycharmProjects\Darknet_project\venv\lib\site-packages\tensorflow\python\framework\errors_impl.py", line 528, in __exit__
    c_api.TF_GetCode(self.status.status))
tensorflow.python.framework.errors_impl.NotFoundError: NewRandomAccessFile failed to Create/Open: built_graph/tiny-yolo-voc-52c.pb : The system cannot find the path specified.
; No such process

Process finished with exit code 1
ankitAMD commented 4 years ago

Currently I have two files in build/graph folder: tiny-yolo-voc-52c.meta tiny-yolo-voc-52c.pb

I'm trying to run the following script

import cv2  #Open Source Computer Vision is a library which helps in real-time computer vision and used for Image Processing
from darkflow.net.build import TFNet     #Tfnet is a class in build.py python files through which  Translate darknet to tensorflow.
import matplotlib.pyplot as plt          #it is used for data visualization

#%config InlineBackend.figure_format = 'svg'

# define the model options and run

# Training the model
# define the model options and run
#This step involves training your model based on dataset and labels you generated*

options = {
    'metaLoad':"built_graph/tiny-yolo-voc-52c.meta",
    'pbLoad':"built_graph/tiny-yolo-voc-52c.pb",
    'threshold': 0.07,
    'cpu': 1.0

     }
tfnet = TFNet(options)

I don't understand the error What can I do to fix it?

C:\Users\Mikko\PycharmProjects\Darknet_project\venv\Scripts\python.exe C:/Users/Mikko/PycharmProjects/Darknet_project/Main.py
C:\Users\Mikko\PycharmProjects\Darknet_project\venv\lib\site-packages\tensorflow\python\framework\dtypes.py:526: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint8 = np.dtype([("qint8", np.int8, 1)])
C:\Users\Mikko\PycharmProjects\Darknet_project\venv\lib\site-packages\tensorflow\python\framework\dtypes.py:527: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_quint8 = np.dtype([("quint8", np.uint8, 1)])
C:\Users\Mikko\PycharmProjects\Darknet_project\venv\lib\site-packages\tensorflow\python\framework\dtypes.py:528: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint16 = np.dtype([("qint16", np.int16, 1)])
C:\Users\Mikko\PycharmProjects\Darknet_project\venv\lib\site-packages\tensorflow\python\framework\dtypes.py:529: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_quint16 = np.dtype([("quint16", np.uint16, 1)])
C:\Users\Mikko\PycharmProjects\Darknet_project\venv\lib\site-packages\tensorflow\python\framework\dtypes.py:530: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint32 = np.dtype([("qint32", np.int32, 1)])
C:\Users\Mikko\PycharmProjects\Darknet_project\venv\lib\site-packages\tensorflow\python\framework\dtypes.py:535: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  np_resource = np.dtype([("resource", np.ubyte, 1)])

Loading from .pb and .meta
WARNING:tensorflow:From C:\Users\Mikko\PycharmProjects\Darknet_project\darkflow-master\darkflow\net\build.py:82: FastGFile.__init__ (from tensorflow.python.platform.gfile) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.gfile.GFile.
Traceback (most recent call last):
  File "C:/Users/Mikko/PycharmProjects/Darknet_project/Main.py", line 22, in <module>
    tfnet = TFNet(options)
  File "C:\Users\Mikko\PycharmProjects\Darknet_project\darkflow-master\darkflow\net\build.py", line 55, in __init__
    self.build_from_pb()
  File "C:\Users\Mikko\PycharmProjects\Darknet_project\darkflow-master\darkflow\net\build.py", line 84, in build_from_pb
    graph_def.ParseFromString(f.read())
  File "C:\Users\Mikko\PycharmProjects\Darknet_project\venv\lib\site-packages\tensorflow\python\lib\io\file_io.py", line 125, in read
    self._preread_check()
  File "C:\Users\Mikko\PycharmProjects\Darknet_project\venv\lib\site-packages\tensorflow\python\lib\io\file_io.py", line 85, in _preread_check
    compat.as_bytes(self.__name), 1024 * 512, status)
  File "C:\Users\Mikko\PycharmProjects\Darknet_project\venv\lib\site-packages\tensorflow\python\framework\errors_impl.py", line 528, in __exit__
    c_api.TF_GetCode(self.status.status))
tensorflow.python.framework.errors_impl.NotFoundError: NewRandomAccessFile failed to Create/Open: built_graph/tiny-yolo-voc-52c.pb : The system cannot find the path specified.
; No such process

Process finished with exit code 1

First thing i have suggested if you running code using my github then i have some condition. My condition is i have not enough memory to run the code so i use very small layers of neural network (tiny-yolo.cfg) . I have not have GPU so that's why i am not using GPU. I have very very less training dataset for training. I am not using Pycharm. I am using Jupyter Notebook. I am using Tensorflow. I am using Ubuntu 16.04 as OS. I am using threshold very less 0.07 which are very poor (7/100) this is because not enough dataset and training processor,memory. So i have only want to try to check myself that is i can run this project or not . If you using enough dataset and GPU processing power than increase the threshold . change the thresold at last time to check results and output.

ankitAMD commented 4 years ago

Currently I have two files in build/graph folder: tiny-yolo-voc-52c.meta tiny-yolo-voc-52c.pb

I'm trying to run the following script

import cv2  #Open Source Computer Vision is a library which helps in real-time computer vision and used for Image Processing
from darkflow.net.build import TFNet     #Tfnet is a class in build.py python files through which  Translate darknet to tensorflow.
import matplotlib.pyplot as plt          #it is used for data visualization

#%config InlineBackend.figure_format = 'svg'

# define the model options and run

# Training the model
# define the model options and run
#This step involves training your model based on dataset and labels you generated*

options = {
    'metaLoad':"built_graph/tiny-yolo-voc-52c.meta",
    'pbLoad':"built_graph/tiny-yolo-voc-52c.pb",
    'threshold': 0.07,
    'cpu': 1.0

     }
tfnet = TFNet(options)

I don't understand the error What can I do to fix it?

C:\Users\Mikko\PycharmProjects\Darknet_project\venv\Scripts\python.exe C:/Users/Mikko/PycharmProjects/Darknet_project/Main.py
C:\Users\Mikko\PycharmProjects\Darknet_project\venv\lib\site-packages\tensorflow\python\framework\dtypes.py:526: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint8 = np.dtype([("qint8", np.int8, 1)])
C:\Users\Mikko\PycharmProjects\Darknet_project\venv\lib\site-packages\tensorflow\python\framework\dtypes.py:527: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_quint8 = np.dtype([("quint8", np.uint8, 1)])
C:\Users\Mikko\PycharmProjects\Darknet_project\venv\lib\site-packages\tensorflow\python\framework\dtypes.py:528: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint16 = np.dtype([("qint16", np.int16, 1)])
C:\Users\Mikko\PycharmProjects\Darknet_project\venv\lib\site-packages\tensorflow\python\framework\dtypes.py:529: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_quint16 = np.dtype([("quint16", np.uint16, 1)])
C:\Users\Mikko\PycharmProjects\Darknet_project\venv\lib\site-packages\tensorflow\python\framework\dtypes.py:530: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint32 = np.dtype([("qint32", np.int32, 1)])
C:\Users\Mikko\PycharmProjects\Darknet_project\venv\lib\site-packages\tensorflow\python\framework\dtypes.py:535: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  np_resource = np.dtype([("resource", np.ubyte, 1)])

Loading from .pb and .meta
WARNING:tensorflow:From C:\Users\Mikko\PycharmProjects\Darknet_project\darkflow-master\darkflow\net\build.py:82: FastGFile.__init__ (from tensorflow.python.platform.gfile) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.gfile.GFile.
Traceback (most recent call last):
  File "C:/Users/Mikko/PycharmProjects/Darknet_project/Main.py", line 22, in <module>
    tfnet = TFNet(options)
  File "C:\Users\Mikko\PycharmProjects\Darknet_project\darkflow-master\darkflow\net\build.py", line 55, in __init__
    self.build_from_pb()
  File "C:\Users\Mikko\PycharmProjects\Darknet_project\darkflow-master\darkflow\net\build.py", line 84, in build_from_pb
    graph_def.ParseFromString(f.read())
  File "C:\Users\Mikko\PycharmProjects\Darknet_project\venv\lib\site-packages\tensorflow\python\lib\io\file_io.py", line 125, in read
    self._preread_check()
  File "C:\Users\Mikko\PycharmProjects\Darknet_project\venv\lib\site-packages\tensorflow\python\lib\io\file_io.py", line 85, in _preread_check
    compat.as_bytes(self.__name), 1024 * 512, status)
  File "C:\Users\Mikko\PycharmProjects\Darknet_project\venv\lib\site-packages\tensorflow\python\framework\errors_impl.py", line 528, in __exit__
    c_api.TF_GetCode(self.status.status))
tensorflow.python.framework.errors_impl.NotFoundError: NewRandomAccessFile failed to Create/Open: built_graph/tiny-yolo-voc-52c.pb : The system cannot find the path specified.
; No such process

Process finished with exit code 1

Your error is: built_graph/tiny-yolo-voc-52c.pb : The system cannot find the path specified.

Check your locations and path of file(/tiny-yolo-voc-52c.pb).