title: While using YOLO and OpenCV getting an error - No such file or directory: 'labels.txt'
body: <p>I am new to Yolo and OpenCV. While performing the below code</p>
  <pre><code>options = {
   'model': 'C:/Users/parme/OneDrive/Desktop/darknet-master/darknet-master/cfg/yolov2.cfg',
   'load': 'C:/Users/parme/OneDrive/Desktop/darknet-master/darknet-master/build/darknet/x64/yolov2.weights',
   'threshold': 0.3
      
  }
  tfnet = TFNet(options)
  cap = cv2.VideoCapture('sample.mp4')
  colors=[tuple(255 * np.random.rand(3)) for i in range(5)]
  while(cap.isOpened()):
      stime= time.time()
      ret, frame = cap.read()
      results = tfnet.return_predict(frame)
      if ret:
          for color, result in zip(colors, results):
              tl = (result['topleft']['x'], result['topleft']['y'])
              br = (result['bottomright']['x'], result['bottomright']['y'])
              label = result['label']
              frame= cv2.rectangle(frame, tl, br, color, 7)
              frame= cv2.putText(frame, label, tl, cv2.FONT_HERSHEY_TRIPLEX, 1, (0,0,0), 2)
          cv2.imshow('frame', frame)
          print('FPS {:1f}'.format(1/(time.time() -stime)))
          if cv2.waitKey(1)  &amp; 0xFF == ord('q'):
              break
      else:
          break
  cap.release()
  cv2.destroyAllWindows()
  </code></pre>
  <p>I am getting the below error. It is saying labels.txt not found. I have tried searching for it and provided a few links I have tried.</p>
  <pre><code>Parsing C:/Users/parme/OneDrive/Desktop/darknet-master/darknet-master/cfg/yolov2.cfg
  Loading C:/Users/parme/OneDrive/Desktop/darknet-master/darknet-master/build/darknet/x64/yolov2.weights ...
  Successfully identified 203934260 bytes
  Finished in 0.034906864166259766s
  ---------------------------------------------------------------------------
  FileNotFoundError                         Traceback (most recent call last)
  &lt;ipython-input-36-9a5fed223d95&gt; in &lt;module&gt;
        5 
        6 }
  ----&gt; 7 tfnet = TFNet(options)
        8 cap = cv2.VideoCapture('sample.mp4')
        9 colors=[tuple(255 * np.random.rand(3)) for i in range(5)]
  
  ~\anaconda3\envs\DAB300- ML2\lib\site-packages\darkflow\net\build.py in __init__(self, FLAGS, darknet)
       62                 args = [darknet.meta, FLAGS]
       63                 self.num_layer = len(darknet.layers)
  ---&gt; 64                 self.framework = create_framework(*args)
       65 
       66                 self.meta = darknet.meta
  
  ~\anaconda3\envs\DAB300- ML2\lib\site-packages\darkflow\net\framework.py in create_framework(meta, FLAGS)
       57     net_type = meta['type']
       58     this = types.get(net_type, framework)
  ---&gt; 59     return this(meta, FLAGS)
  
  ~\anaconda3\envs\DAB300- ML2\lib\site-packages\darkflow\net\framework.py in __init__(self, meta, FLAGS)
       13         meta['name'] = model
       14 
  ---&gt; 15         self.constructor(meta, FLAGS)
       16 
       17     def is_inp(self, file_name):
  
  ~\anaconda3\envs\DAB300- ML2\lib\site-packages\darkflow\net\yolo\__init__.py in constructor(self, meta, FLAGS)
       18                 return (b * 127, r * 127, g * 127)
       19         if 'labels' not in meta:
  ---&gt; 20                 misc.labels(meta, FLAGS) #We're not loading from a .pb so we do need to load the labels
       21     assert len(meta['labels']) == meta['classes'], (
       22                 'labels.txt and {} indicate' + ' '
  
  ~\anaconda3\envs\DAB300- ML2\lib\site-packages\darkflow\net\yolo\misc.py in labels(meta, FLAGS)
       34             print(&quot;Model has name yolo9000, loading yolo9000 labels.&quot;)
       35             file = os.path.join(FLAGS.config, nine_names)
  ---&gt; 36         with open(file, 'r') as f:
       37             meta['labels'] = list()
       38             labs = [l.strip() for l in f.readlines()]
  
  FileNotFoundError: [Errno 2] No such file or directory: 'labels.txt'
  </code></pre>
  <p>Please if anyone could let me know how to solve this issue. I have tried following
  <a href="https://github.com/thtrieu/darkflow/issues/790" rel="nofollow noreferrer">https://github.com/thtrieu/darkflow/issues/790</a> and
  <a href="https://github.com/thtrieu/darkflow/issues/75" rel="nofollow noreferrer">https://github.com/thtrieu/darkflow/issues/75</a>
  Still not working.</p>