ZoneMinder / zmeventnotification

Machine Learning powered Secure Websocket & MQTT based ZoneMinder event notification server
412 stars 128 forks source link

Permission error when trying to train faces #295

Closed peste85 closed 4 years ago

peste85 commented 4 years ago

First off i want to say incredible work and thank you for sharing this project with us.

Event Server version

5.15.6

Zoneminder version

1.34.19

What is the nature of your issue

Possible bug?

Details

I am running Dlandon's docker and I am attempting to train the faces however i am getting an permission denied error.

I have added full permissions to the directory and to the image, not sure what else it might be.

I added 1 image and attempted to run the train command

sudo -u www-data /var/lib/zmeventnotification/bin/zm_train_faces.py

and getting the following error

root@a260730bda6d:/var/lib/zmeventnotification/known_faces# sudo -u www-data /var/lib/zmeventnotification/bin/zm_train_faces.py CONSOLE:Face Recognition library load time took: 0.003 milliseconds CONSOLE:secret filename: /etc/zm/secrets.ini CONSOLE:Secret token found in config: !ZM_PORTAL CONSOLE:Secret token found in config: !ZM_API_PORTAL CONSOLE:Secret token found in config: !ZM_USER CONSOLE:Secret token found in config: !ZM_PASSWORD CONSOLE:Secret token found in config: !ML_USER CONSOLE:Secret token found in config: !ML_PASSWORD CONSOLE:Secret token found in config: !PLATEREC_ALPR_KEY CONSOLE:allowing self-signed certs to work... CONSOLE:Ignoring monitor specific settings, as you did not provide a monitor id CONSOLE:key [config] is '/var/lib/zmeventnotification/models/yolov3/yolov3.cfg' after substitution CONSOLE:key [weights] is '/var/lib/zmeventnotification/models/yolov3/yolov3.weights' after substitution CONSOLE:key [labels] is '/var/lib/zmeventnotification/models/yolov3/coco.names' after substitution CONSOLE:key [tiny_config] is '/var/lib/zmeventnotification/models/tinyyolo/yolov3-tiny.cfg' after substitution CONSOLE:key [tiny_weights] is '/var/lib/zmeventnotification/models/tinyyolo/yolov3-tiny.weights' after substitution CONSOLE:key [tiny_labels] is '/var/lib/zmeventnotification/models/tinyyolo/yolov3-tiny.txt' after substitution CONSOLE:key [known_images_path] is '/var/lib/zmeventnotification/known_faces' after substitution CONSOLE:key [unknown_images_path] is '/var/lib/zmeventnotification/unknown_faces' after substitution CONSOLE:rosa is a directory. Processing all images inside it CONSOLE:loading face from rosa/1.jpg CONSOLE:Using n_neighbors to be: 1 CONSOLE:Training model ... Traceback (most recent call last): File "/var/lib/zmeventnotification/bin/zm_train_faces.py", line 26, in <module> train.train() File "/usr/local/lib/python3.6/dist-packages/zmes_hook_helpers/face_train.py", line 127, in train f = open(encoding_file_name, "wb") PermissionError: [Errno 13] Permission denied: '/var/lib/zmeventnotification/known_faces/faces.dat'

Thanks!

pliablepixels commented 4 years ago

Does www-data have write permissions to /var/lib/zmeventnotification/known_faces/ and if faces.dat exists, does it have www-data ownership?

peste85 commented 4 years ago

So something weird happened and my docker got corrupted, i had to start over and now its working, weird. Sorry to be bugging you and thank you for the support. Once again incredible project

pliablepixels commented 4 years ago

no worries.