CellProfiler-Analyst icon indicating copy to clipboard operation
CellProfiler-Analyst copied to clipboard

Problem saving and loading model created with FGB

Open bethac07 opened this issue 9 years ago • 8 comments

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)

bethac07 avatar Jul 19 '16 19:07 bethac07

Maybe related with #207 ? It might also be related to commit 298648a .

daviddao avatar Jul 19 '16 21:07 daviddao

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.

daviddao avatar Jul 19 '16 22:07 daviddao

Perhaps include logic to disable the "Save model" file item until/unless the model exists/is populated?

braymp avatar Jul 20 '16 00:07 braymp

I can't reproduce

jhung0 avatar Jul 21 '16 08:07 jhung0

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.

daviddao avatar Jul 22 '16 12:07 daviddao

Is this issue just for FGB, or for all classifiers in general?

braymp avatar Jul 22 '16 12:07 braymp

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 avatar Jul 22 '16 13:07 daviddao

@daviddao did you create the warning?

jhung0 avatar Dec 16 '16 15:12 jhung0