vardanagarwal / Proctoring-AI

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

Hi, OSError, but error msg is 'Is a directory '. Any suggestions? #27

Closed kshamap closed 3 years ago

kshamap commented 3 years ago

Hi, I am getting similar error , but error msg is 'Is a directory '. Any suggestions?

Traceback (most recent call last): File "head_pose_estimation.py", line 131, in landmark_model = get_landmark_model() File "/root/Proctoring-AI/face_landmarks.py", line 31, in get_landmark_model model = keras.models.load_model(saved_model) File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/saving/hdf5_format.py", line 203, in load_model f = h5py.File(filepath, mode='r') File "/usr/local/lib/python3.6/dist-packages/h5py/_hl/files.py", line 408, in init swmr=swmr) File "/usr/local/lib/python3.6/dist-packages/h5py/_hl/files.py", line 173, 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 88, in h5py.h5f.open OSError: Unable to open file (file read failed: time = Tue Oct 27 12:16:21 2020 , filename = 'models/pose_model', file descriptor = 3, errno = 21, error message = 'Is a directory', buf = 0x7ffd0fa0e910, total read size = 8, bytes this sub-read = 8, bytes actually read = 18446744073709551615, offset = 0)

Name: numpy Version: 1.19.2

Name:tensorflow Version:2.0.0-alpha0

Originally posted by @kshamap in https://github.com/vardanagarwal/Proctoring-AI/issues/10#issuecomment-717173617

vardanagarwal commented 3 years ago

Hi, can you make sure you have a folder called models where the pose_model directory is placed. If it not there and you want to use a custom location then you pass it as a parameter in get_landmarks_model().

kshamap commented 3 years ago

Hi , I do have pose_model directory in models folder.

vardanagarwal commented 3 years ago

I don't know then why it causing you this problem. I checked my Tensorflow version is 2.1.0 and the NumPy version is 1.19.1. Maybe you can update your TensorFlow version and it might work.

vardanagarwal commented 3 years ago

Have a look at the answer to this Stack Overflow question on your issue. Maybe putting the pose_model in the working directory and passing get_landmarks_model("pose_model") might work for you.

kshamap commented 3 years ago

Hey , Yay fixed it .

Upgraded tensorflow from Version:2.0.0-alpha0 to 2.0.0-beta1.

Thanks for your fast replies.

pranav-x commented 3 years ago

Hey , Yay fixed it .

Upgraded tensorflow from Version:2.0.0-alpha0 to 2.0.0-beta1.

Thanks for your fast replies.

Hey i have upgraded tf version but i am still getting this error.

vardanagarwal commented 3 years ago

Pls try TensorFlow 2.2