0

I am running a Python program in Raspberry Pi on startup (autostart) that I have placed in .bashrc but on startup, OpenCV code snippet contained file is not loading but normal Python program is running and I was using KNN(K Nearest Neighbour) on this algorithm I am getting the following error.

Traceback (most recent call last):
File "Desktop/carPlate/main.py", line 15, in <module>
import DetectChars
File "/home/pi/Desktop/carPlate/DetectChars.py", line 11, in <module>
kNearest = cv2.ml.KNearest_create()
AttributeError: 'module' object has no attribute 'ml'
Georgy
  • 12,464
  • 7
  • 65
  • 73
J.Doe
  • 51
  • 9
  • Unless you show us some code, we cannot tell what goes wrong here. The error message says that `cv2` is of type `module` and as such has no attribute (member?) `ml`. This might be a simple typing error or some wrong project settings. – TobiMcNamobi Jan 28 '19 at 11:30
  • Are you sure you have OpenCV >3.0? https://stackoverflow.com/questions/29369907/opencv-3-0-0-beta-missing-knn – Georgy Jan 28 '19 at 13:38

0 Answers0