bikz05 / bag-of-words

Python Implementation of Bag of Words for Image Recognition using OpenCV and sklearn
217 stars 106 forks source link

'LinearSVC' object has no attribute 'classes_' #4

Closed powderblock closed 9 years ago

powderblock commented 9 years ago

I get this error when trying to run getClass.py with the args -t dataset/test --visualize. I think this is an issue with LinearSVC and not my end, but I wanted to make sure.

predictions = [classes_names[i] for i in clf.predict(test_features)] File "C:\Python27\lib\site-packages\sklearn\linear_model\base.py", line 228, in predict return self._classes_[indices] AttributeError: 'LinearSVC' object has no attribute 'classes_'

Anyone having this issue?

powderblock commented 9 years ago

This fixed itself, which is weird.

I re-trained in and now it no longer happens. Huh.

orensig commented 7 years ago

@powderblock Hi, how did you retrain the model? I need to do same