bikz05 / digit-recognition

Handwritten Digit Recognition using OpenCV, sklearn and Python
131 stars 90 forks source link

sklearn.utils.validation.NotFittedError #6

Closed vkkan closed 6 years ago

vkkan commented 6 years ago

Python 2.7.12 OpenCV 3.4.0

python performRecognition.py -c digits_cls.pkl -i photo_1.jpg

Traceback (most recent call last): File "performRecognition.py", line 52, in roi_hog_fd = pp.transform(np.array([roi_hog_fd], 'float64')) File "/usr/lib/python2.7/dist-packages/sklearn/preprocessing/data.py", line 638, in transform check_isfitted(self, 'scale') File "/usr/lib/python2.7/dist-packages/sklearn/utils/validation.py", line 678, in check_is_fitted raise NotFittedError(msg % {'name': type(estimator).name}) sklearn.utils.validation.NotFittedError: This StandardScaler instance is not fitted yet. Call 'fit' with appropriate arguments before using this method.

Pls help me to fix this error

vkkan commented 6 years ago

I am answering my own issue: I have regenerated the classifier and run the recognition vola its working :-) thanks