MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    MMM-Facial-Recognition-OCV3 -> tools.train.py Problem

    Scheduled Pinned Locked Moved Unsolved Troubleshooting
    2 Posts 2 Posters 921 Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • N Offline
      necRom
      last edited by

      Hello guys,
      its my first post here. I am not that firm in Python but already had done some things in C. So lets say i´m a beginner in coding and a beginner in Raspberrys.

      I installed MM2 and some modules, which are working after some tweaking. But currently i´m having big problems with the Facial Recognition Module (OCV3).

      “Everything” installed, did it two times on two rasps and got to the same error:
      python tools.capture.py
      does work. I´m capturing images, they are saved and cropped and whatever.

      But when i try
      python train.tools.py
      i get:

      Remember to set the name list environment variable FACE_USERS
      Reading training images...
      --------------------
      Assign label 1 to xxx
      Assign label 2 to xxc
      --------------------
      
      Read 43 positive images and 400 negative images.
      
      7 images from subject xxx
      36 images from subject xxc
      --------------------
      
      Training model with threshold 80
      Traceback (most recent call last):
        File "tools.train.py", line 14, in <module>
          ToolsTrain().train()
        File "/home/pi/MagicMirror/modules/MMM-Facial-Recognition-OCV3/lib/tools/train.py", line 71, in train
          model = ToolsConfig.model()
        File "/home/pi/MagicMirror/modules/MMM-Facial-Recognition-OCV3/lib/tools/config.py", line 99, in model
          return CommonConfig.model(cls.POSITIVE_THRESHOLD)
        File "/home/pi/MagicMirror/modules/MMM-Facial-Recognition-OCV3/lib/common/commonconfig.py", line 51, in model
          model = cv2.face.LBPHFaceRecognizer_create(threshold=thresh)
      AttributeError: 'module' object has no attribute 'face'
      
      

      and with python3 tools.train.py

      Traceback (most recent call last):
        File "tools.train.py", line 10, in <module>
          from lib.tools.train import ToolsTrain
        File "/home/pi/MagicMirror/modules/MMM-Facial-Recognition-OCV3/lib/tools/train.py", line 17, in <module>
          import cv2
        File "/usr/local/lib/python3.5/dist-packages/cv2/__init__.py", line 3, in <module>
          from .cv2 import *
      ImportError: libhdf5_serial.so.100: cannot open shared object file: No such file or directory
      
      

      python2 tools.train.py
      gives the same result as
      python

      I am directly writing on the rasp, not connected by ssh or so.

      opencv, opencv_contrib are installed, pip is there.
      It looks like cv2 is not there … when i use python and then import cv2
      there is no error. But when i then ask for help(cv2.face) the error appears:
      AttributeError: module object has no attribute face

      I got Python 2 (ver 2.7.13) and Python 3 (ver 3.5.3), numpy (ver 1.12.1), OpenCV (ver 3.3.0)

      Maybe i did not install everything needed? But it worked till the train part. Maybe some links are missing or wrong?
      I hope you can bring up some ideas or at best a working solution ^^.

      Thanks
      Nec

      1 Reply Last reply Reply Quote 0
      • B Offline
        Bernard-h
        last edited by

        Im having the exact same error readings. Frustrating. Has anyone managed to tackle or solve this issue?

        1 Reply Last reply Reply Quote 0

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        • 1 / 1
        • First post
          Last post
        Enjoying MagicMirror? Please consider a donation!
        MagicMirror created by Michael Teeuw.
        Forum managed by Sam, technical setup by Karsten.
        This forum is using NodeBB as its core | Contributors
        Contact | Privacy Policy