vardanagarwal / Proctoring-AI

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

head_pose_estimation.py OSError #10

Closed tjthejuggler closed 4 years ago

tjthejuggler commented 4 years ago

I'm getting this error when trying to run it. Only possible lead I have found is that maybe saved_model.pb is corrupt, but I really have no idea.

C:\Users\Thursday\Anaconda3\lib\site-packages\tensorflow\python\framework\dtypes.py:493: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_qint8 = np.dtype([("qint8", np.int8, 1)]) C:\Users\Thursday\Anaconda3\lib\site-packages\tensorflow\python\framework\dtypes.py:494: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_quint8 = np.dtype([("quint8", np.uint8, 1)]) C:\Users\Thursday\Anaconda3\lib\site-packages\tensorflow\python\framework\dtypes.py:495: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_qint16 = np.dtype([("qint16", np.int16, 1)]) C:\Users\Thursday\Anaconda3\lib\site-packages\tensorflow\python\framework\dtypes.py:496: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_quint16 = np.dtype([("quint16", np.uint16, 1)]) C:\Users\Thursday\Anaconda3\lib\site-packages\tensorflow\python\framework\dtypes.py:497: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_qint32 = np.dtype([("qint32", np.int32, 1)]) C:\Users\Thursday\Anaconda3\lib\site-packages\tensorflow\python\framework\dtypes.py:502: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. np_resource = np.dtype([("resource", np.ubyte, 1)]) Traceback (most recent call last): File "head_pose_estimation.py", line 128, in landmark_model = get_landmark_model() File "C:\Users\Thursday\Projects\Proctoring-AI\face_landmarks.py", line 30, in get_landmark_model model = keras.models.load_model(saved_model) File "C:\Users\Thursday\Anaconda3\lib\site-packages\tensorflow\python\keras_impl\keras\models.py", line 240, in load_model with h5py.File(filepath, mode='r') as f: File "C:\Users\Thursday\Anaconda3\lib\site-packages\h5py_hl\files.py", line 408, in init swmr=swmr) File "C:\Users\Thursday\Anaconda3\lib\site-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 (unable to open file: name = 'models/pose_model', errno = 13, error message = 'Permission denied', flags = 0, o_flags = 0)

vardanagarwal commented 4 years ago

You are getting a permission denied error. So can you make sure you have not placed your model in root directories where you typically won't have write permissions. Also, can you verify that you are using Tensorflow>2? Also, I have NumPy version=1.19.1 installed so if you have an older version you can update it.

tjthejuggler commented 4 years ago

That did it! It works now, thank you so much! Really looking forward to playing around with this, I imagined this exact thing and was stoked to see it already existed.

Just for the record, this is exactly what I did -

pip show numpy Version: 1.17.0 pip install numpy --upgrade Version: 1.19.1 installed python head_pose_estimation.py (attempt to run) Same error as before pip show tensorflow Version: 1.5.0 pip install tensorflow --upgrade Version 2.3.0 installed this uninstalled numpy 1.19.1 and put 1.18.5 in its place python head_pose_estimation.py (attempt to run) Works beautifully!

Thanks again!!

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