vardanagarwal / Proctoring-AI

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

unable load weights models/pose_model #28

Closed shilezhang closed 3 years ago

shilezhang commented 3 years ago

Hello, when I run eye_tracker.py, I got the error: File "eye_tracker.py", line 154, in <module> landmark_model = get_landmark_model() File "~/Proctoring-AI/face_landmarks.py", line 30, in get_landmark_model model = keras.models.load_model(saved_model) File "~/.virtualenvs/cv/lib/python3.6/site-packages/tensorflow/python/keras/_impl/keras/engine/saving.py", line 235, in load_model with h5py.File(filepath, mode='r') as f: File "~/.virtualenvs/cv/lib/python3.6/site-packages/h5py/_hl/files.py", line 394, in __init__ swmr=swmr) File "~/.virtualenvs/cv/lib/python3.6/site-packages/h5py/_hl/files.py", line 170, in make_fid fid = h5f.open(name, flags, fapl=fapl) File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper File "h5py/h5f.pyx", line 85, in h5py.h5f.open OSError: Unable to open file (file read failed: time = Tue Oct 27 14:43:05 2020 , filename = 'models/pose_model', file descriptor = 3, errno = 21, error message = 'Is a directory', buf = 0x7fff830498d0, total read size = 8, bytes this sub-read = 8, bytes actually read = 18446744073709551615, offset = 0) I think the weights for detecting facial landmarks has a problem. I tried to download from pre-trained CNN weights https://github.com/yinguobing/head-pose-estimation and still not working. Can anyone pls offer a clue?

vardanagarwal commented 3 years ago

@shilezhang pls have a look here

shilezhang commented 3 years ago

@shilezhang pls have a look here

Hi Vardan, thanks for replying. I tried to put the weights file in current path but it's not working. Finally upgrading TensorFlow to 2+ solved my problem!