Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: #19

Closed
herokarimpoor opened this issue Sep 19, 2020 · 4 comments
Closed

TypeError: #19

herokarimpoor opened this issue Sep 19, 2020 · 4 comments

Comments

@herokarimpoor
Copy link

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
Copy link
Owner

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

@herokarimpoor
Copy link
Author

hi
Thank you for your reply

@herokarimpoor
Copy link
Author

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
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants