naisy / realtime_object_detection

Plug and Play Real-Time Object Detection App with Tensorflow and OpenCV. No Bugs No Worries. Enjoy!
MIT License
101 stars 36 forks source link

IOError: Couldn't open video file or webcam #70

Open abdallah0012 opened 5 years ago

abdallah0012 commented 5 years ago

Hello when i run this: python "run_stream.py" with my jetson xavier and logitech c930e. note that have this in config.yml (camera_input: 1 ) i have this error ;

run_stream.py:59: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details. cfg = yaml.load(ymlfile) Building Graph Loading label map Loading... 2019-05-13 08:57:17.050768: W tensorflow/core/platform/profile_utils/cpu_utils.cc:98] Failed to find bogomips in /proc/cpuinfo; cannot determine CPU frequency 2019-05-13 08:57:17.051788: I tensorflow/compiler/xla/service/service.cc:161] XLA service 0x7f181a8850 executing computations on platform Host. Devices: 2019-05-13 08:57:17.051872: I tensorflow/compiler/xla/service/service.cc:168] StreamExecutor device (0): , 2019-05-13 08:57:17.129784: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:965] ARM64 does not support NUMA - returning NUMA node zero 2019-05-13 08:57:17.130216: I tensorflow/compiler/xla/service/service.cc:161] XLA service 0x7f1825c7b0 executing computations on platform CUDA. Devices: 2019-05-13 08:57:17.130335: I tensorflow/compiler/xla/service/service.cc:168] StreamExecutor device (0): Xavier, Compute Capability 7.2 2019-05-13 08:57:17.130784: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1433] Found device 0 with properties: name: Xavier major: 7 minor: 2 memoryClockRate(GHz): 1.5 pciBusID: 0000:00:00.0 totalMemory: 15.45GiB freeMemory: 7.49GiB 2019-05-13 08:57:17.130880: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1512] Adding visible gpu devices: 0 2019-05-13 08:57:17.861107: I tensorflow/core/common_runtime/gpu/gpu_device.cc:984] Device interconnect StreamExecutor with strength 1 edge matrix: 2019-05-13 08:57:17.861262: I tensorflow/core/common_runtime/gpu/gpu_device.cc:990] 0 2019-05-13 08:57:17.861314: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1003] 0: N 2019-05-13 08:57:17.861569: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1115] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 7027 MB memory)

-> physical GPU (device: 0, name: Xavier, pci bus id: 0000:00:00.0, compute capability: 7.2) 2019-05-13 08:57:17.863335: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1512] Adding visible gpu devices: 0 2019-05-13 08:57:17.863457: I tensorflow/core/common_runtime/gpu/gpu_device.cc:984] Device interconnect StreamExecutor with strength 1 edge matrix: 2019-05-13 08:57:17.863507: I tensorflow/core/common_runtime/gpu/gpu_device.cc:990] 0 2019-05-13 08:57:17.863533: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1003] 0: N 2019-05-13 08:57:17.863637: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1115] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 7027 MB memory) -> physical GPU (device: 0, name: Xavier, pci bus id: 0000:00:00.0, compute capability: 7.2)

(python:15408): GStreamer-CRITICAL **: 08:57:24.898: gst_element_get_state: assertion 'GST_IS_ELEMENT (element)' failed Traceback (most recent call last): File "run_stream.py", line 127, in main detection.start(cfg) File "/home/nvidia/Downloads/realtime_object_detection-master/lib/detection_nms_v2.py", line 192, in start video_reader.start(VIDEO_INPUT, WIDTH, HEIGHT, save_to_file=SAVE_TO_FILE) File "/home/nvidia/Downloads/realtime_object_detection-master/lib/webcam.py", line 74, in start raise IOError(("Couldn't open video file or webcam.")) IOError: Couldn't open video file or webcam.

Help please !!!!

naisy commented 5 years ago

Hi @abdallah0012,

Sorry for my late response. Normally, usb webcamera exists in either /dev/video0 or /dev/video1.

ls /dev/video*

If you find /dev/video0, set the config.yaml to camera_input: 0. If you find /dev/video1, set the config.yaml to camera_input: 1.