CellProfiler-Analyst
CellProfiler-Analyst copied to clipboard
Problem saving and loading model created with FGB
A collaborator who's here working with us locally this week is having trouble saving and loading classifier models (I believe always using the FGB model)- she originally was using 2.2.1 but just downloaded and tried the nightly and had the same problem.
An error occurred in the program:
AttributeError: 'NoneType' object has no attribute 'colnames'
Traceback (most recent call last):
File "/Applications/CellProfiler Analyst.app/Contents/Resources/lib/python2.7/cpa/classifier.py", line 1102, in SaveModel
self.algorithm._set_features(self.trainingSet.colnames)
Maybe related with #207 ? It might also be related to commit 298648a .
Just checked 2.2.1 and I could reproduce the error.
Does she click 'save model' after she clicks 'train' ? If you click before, there won't be a 'trained' classifier model yet and it will cause this error message.
Perhaps include logic to disable the "Save model" file item until/unless the model exists/is populated?
I can't reproduce
That is how I reproduced it: 2.2.1 stable (not nightly) -> Select FGB -> Load the Training Set -> Save Model -> Error.
That's because after selecting FGB, the algorithm haven't yet loaded the trainingSet columns. Pressing 'train' before Save Model will fix the issue. I will create a warning for users.
Is this issue just for FGB, or for all classifiers in general?
It's FGB specific because it has a different source code (legacy from Adam) than our Scikit-Learn library. It should be easy though to add the warning.
@daviddao did you create the warning?