theAIGuysCode / yolov4-custom-functions

A Wide Range of Custom Functions for YOLOv4, YOLOv4-tiny, YOLOv3, and YOLOv3-tiny Implemented in TensorFlow, TFLite, and TensorRT.
MIT License
602 stars 370 forks source link

Error when running on webcam #74

Open Delesoft opened 2 years ago

Delesoft commented 2 years ago

Hallo,i am trying to run the model on webcam but i get the following error

$ python detect_video.py --weights ./checkpoints/yolov4-416 --size 416 --model yolov4 --video 0 --output ./detections/results.avi Traceback (most recent call last): File "detect_video.py", line 178, in app.run(main) File "C:\Users\paulm\AppData\Roaming\Python\Python37\site-packages\absl\app.py", line 312, in run _run_main(main, args) File "C:\Users\paulm\AppData\Roaming\Python\Python37\site-packages\absl\app.py", line 258, in _run_main sys.exit(main(argv)) File "detect_video.py", line 56, in main saved_model_loaded = tf.saved_model.load(FLAGS.weights, tags=[tag_constants.SERVING]) File "C:\Program Files\Python37\lib\site-packages\tensorflow\python\saved_model\load.py", line 590, in load return load_internal(export_dir, tags, options) File "C:\Program Files\Python37\lib\site-packages\tensorflow\python\saved_model\load.py", line 601, in load_internal loader_impl.parse_saved_model_with_debug_info(export_dir)) File "C:\Program Files\Python37\lib\site-packages\tensorflow\python\saved_model\loader_impl.py", line 56, in parse_saved_model_with_debug_info saved_model = _parse_saved_model(export_dir) File "C:\Program Files\Python37\lib\site-packages\tensorflow\python\saved_model\loader_impl.py", line 113, in parse_saved_model constants.SAVED_MODEL_FILENAME_PB)) OSError: SavedModel file does not exist at: ./checkpoints/yolov4-416/{saved_model.pbtxt|saved_model.pb}

huzaifah-here commented 2 years ago

Try this: python detect_video.py --weights ./checkpoints/custom-416 --size 416 --model yolov4 --video 0 --output ./detections/results.avi