BrandonJoffe / home_surveillance

Home surveillance system with facial recognition
1.22k stars 384 forks source link

Error in executing WebApp.py #76

Open StefanoGiu opened 4 years ago

StefanoGiu commented 4 years ago

root@771c49d71c10:/estgiug/estgiug/home_surveillance/system# python WebApp.py /usr/local/lib/python2.7/dist-packages/sklearn/lda.py:4: DeprecationWarning: lda.LDA has been moved to discriminant_analysis.LinearDiscriminantAnalysis in 0.17 and will be removed in 0.19 "in 0.17 and will be removed in 0.19", DeprecationWarning) logging directory already exist Traceback (most recent call last): File "WebApp.py", line 38, in HomeSurveillance = SurveillanceSystem.SurveillanceSystem() File "/estgiug/estgiug/home_surveillance/system/SurveillanceSystem.py", line 120, in init self.recogniser = FaceRecogniser.FaceRecogniser() File "/estgiug/estgiug/home_surveillance/system/FaceRecogniser.py", line 90, in init (self.le, self.clf) = pickle.load(f) # Loads labels and classifier SVM or GMM File "/usr/lib/python2.7/pickle.py", line 1378, in load return Unpickler(file).load() File "/usr/lib/python2.7/pickle.py", line 858, in load dispatchkey File "/usr/lib/python2.7/pickle.py", line 1090, in load_global klass = self.find_class(module, name) File "/usr/lib/python2.7/pickle.py", line 1124, in find_class import(module) ImportError: No module named copy_reg

SimonRijn commented 3 years ago

I fixed it by opening 'home_surveillance/system/classifier.pkl' with notepad++ and covert that to Unix by doing the following steps:

  1. Open the classifier.pkl
  2. Click on search in the menu bar and go to the tab Replace
  3. Find for =\r\n and replace it with = \n
  4. Save the file and run python WebApp.py in your docker container