vardanagarwal / Proctoring-AI

Creating a software for automatic monitoring in online proctoring
MIT License
544 stars 329 forks source link

TypeError: #19

Closed herokarimpoor closed 3 years ago

herokarimpoor commented 3 years ago

hi when i run eye_tracker.py i have a below error: TypeError: slice indices must be integers or None or have an index method

thank you

vardanagarwal commented 3 years ago

Could you please elaborate in which line you are getting this error or if you can put the full error stack here.

herokarimpoor commented 3 years ago

hi Thank you for your reply

herokarimpoor commented 3 years ago

but when i run I have a below error: WARNING:tensorflow:Unable to create a python object for variable <tf.Variable 'layer1/conv2d/kernel:0' shape=(3, 3, 3, 32) dtype=float32_ref> because it is a reference variable. It may not be visible to training APIs. If this is a problem, consider rebuilding the SavedModel after running tf.compat.v1.enable_resource_variables(). WARNING:tensorflow:Unable to create a python object for variable <tf.Variable 'layer1/conv2d/bias:0' shape=(32,) dtype=float32_ref> because it is a reference variable. It may not be visible to training APIs. If this is a problem, consider rebuilding the SavedModel after running tf.compat.v1.enable_resource_variables(). WARNING:tensorflow:Unable to create a python object for variable <tf.Variable 'layer2/conv2d/kernel:0' shape=(3, 3, 32, 64) dtype=float32_ref> because it is a reference variable. It may not be visible to training APIs. If this is a problem, consider rebuilding the SavedModel after running tf.compat.v1.enable_resource_variables(). WARNING:tensorflow:Unable to create a python object for variable <tf.Variable 'layer2/conv2d/bias:0' shape=(64,) dtype=float32_ref> because it is a reference variable. It may not be visible to training APIs. If this is a problem, consider rebuilding the SavedModel after running tf.compat.v1.enable_resource_variables(). WARNING:tensorflow:Unable to create a python object for variable <tf.Variable 'global_step:0' shape=() dtype=int64_ref> because it is a reference variable. It may not be visible to training APIs. If this is a problem, consider rebuilding the SavedModel after running tf.compat.v1.enable_resource_variables(). WARNING:tensorflow:Unable to create a python object for variable <tf.Variable 'layer1/conv2d/kernel:0' shape=(3, 3, 3, 32) dtype=float32_ref> because it is a reference variable. It may not be visible to training APIs. If this is a problem, consider rebuilding the SavedModel after running tf.compat.v1.enable_resource_variables(). WARNING:tensorflow:Unable to create a python object for variable <tf.Variable 'layer1/conv2d/bias:0' shape=(32,) dtype=float32_ref> because it is a reference variable. It may not be visible to training APIs. If this is a problem, consider rebuilding the SavedModel after running tf.compat.v1.enable_resource_variables(). WARNING:tensorflow:Unable to create a python object for variable <tf.Variable 'layer2/conv2d/kernel:0' shape=(3, 3, 32, 64) dtype=float32_ref> because it is a reference variable. It may not be visible to training APIs. If this is a problem, consider rebuilding the SavedModel after running tf.compat.v1.enable_resource_variables(). WARNING:tensorflow:Unable to create a python object for variable <tf.Variable 'layer2/conv2d/bias:0' shape=(64,) dtype=float32_ref> because it is a reference variable. It may not be visible to training APIs. If this is a problem, consider rebuilding the SavedModel after running tf.compat.v1.enable_resource_variables(). Traceback (most recent call last): File "eye_tracker.py", line 175, in rects = find_faces(img, face_model) File "/home/ml/gaze/Proctoring-AI-master/face_detector.py", line 50, in find_faces h, w = img.shape[:2] AttributeError: 'NoneType' object has no attribute 'shape'

vardanagarwal commented 3 years ago

This statement is used for Video capture:

cap = cv2.VideoCapture(0)

The problem you are having is that no image is being is read. So please confirm whether you have a webcam or not. Also, try and replace the 0 with any pre-recorded video you might have.

cap = cv2.VideoCapture("video.mp4")

Make sure the path to video is correct or place it in your working directory.