GazeML
GazeML copied to clipboard
training in TX2
I am trying to train this implementation in TX2.
I made few modifications to webcam.py as below. cv2 recognizes the frames, I tested it out. class WebcamTX2(FramesSource): """Webcam frame grabbing and preprocessing."""
def __init__(self, camera_id=2, fps=120.000000, **kwargs):
"""Create queues and threads to read and preprocess data."""
self._short_name = 'WebcamTX2'
self._capture = cv.VideoCapture("nvcamerasrc ! video/x-raw(memory:NVMM), width=(int)1280, height=(int)720, format=(string)I420, framerate=(fraction)96/1 ! nvvidconv flip-method=6 ! video/x-raw, format=(string)I420 ! videoconvert ! video/x-raw, format=(string)BGR ! appsink")
#self._capture = cv.VideoCapture(camera_id)
#self._capture.set(cv.CAP_PROP_FRAME_WIDTH, 1280)
#self._capture.set(cv.CAP_PROP_FRAME_HEIGHT, 720)
#self._capture.set(cv.CAP_PROP_FOURCC, cv.VideoWriter_fourcc(*'MJPG'))
#self._capture.set(cv.CAP_PROP_FPS, fps)
# Call parent class constructor
super().__init__(**kwargs)
def frame_generator(self):
"""Read frame from webcam."""
if not self._capture.isOpened() :
print("not capture")
exit()
ret,bgr = self._capture.read()
while True:
ret, bgr = self._capture.read()
if ret:
yield bgr
I run into errors on executing elg_demo.py. Below is the stack trace. Can you please guide me in debugging this?
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py", line 1599, in exit
self._default_graph_context_manager.exit(exec_type, exec_value, exec_tb)
File "/usr/lib/python3.5/contextlib.py", line 77, in exit
self.gen.throw(type, value, traceback)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/ops.py", line 5285, in get_controller
yield g
File "/usr/lib/python3.5/contextlib.py", line 77, in exit
self.gen.throw(type, value, traceback)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/ops.py", line 5093, in get_controller
yield default
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/ops.py", line 5285, in get_controller
yield g
File "/usr/lib/python3.5/contextlib.py", line 77, in exit
self.gen.throw(type, value, traceback)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/eager/context.py", line 295, in _mode
yield
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/ops.py", line 5285, in get_controller
yield g
File "elg_demo.py", line 98, in
Thanks for the help. Shreyas
It seems that you have problems with dlib
files.
Have you checked the dlib pre-trained model file?
Normally it occurs when you did not download the raw file directly.