-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
error when scoring an image using any trained classifier that isn't "Fast Gentle Boosting" #178
Comments
@jhung0 can you look at that code? https://github.com/CellProfiler/CellProfiler-Analyst/blame/master/cpa/multiclasssql.py#L153-L157 |
Can you ask whether they have any idea what data types are there? On Wed, May 4, 2016 at 7:32 AM, David Dao notifications@github.com wrote:
|
Is there a dictionary or something? |
Also if dtype is object |
Can we check for that automatically? Return an error if dtype is object. |
yeah we can add a line to check the type On Thu, May 5, 2016 at 8:44 AM, David Dao notifications@github.com wrote:
|
Now an exception should be raised if the type is object. If not, it should print the data type. |
I posted in the forums, but forgot to cross-post here: I've installed the latest nightly (with commit I'm going to guess this means there may be some missing values in the data exported from the CellProfiler pipeline? Is there an easy way to fill these or make sure the types are consistent in my data set? |
Ok, I might have found the problem... |
Just downloaded the latest nightly and recieved essentially the original error:
Is there a way I can sanitize my input? Or alternatively, something I can look for in my data set that would help debug this? NaNs or missing values perhaps? |
Sorry about that. On Thu, May 26, 2016 at 1:21 AM, Jon Charest notifications@github.com
|
Also, there should be something printed, either data type 1 .... or data On Thu, May 26, 2016 at 8:43 AM, Jane Hung jyhung@broadinstitute.org
|
I definitely have some values that are |
I didn't see anything else printed with the error message. |
I had a line handling None, but it might have messed up the dtype of the numpy array and so led to the error. |
On the latest nightly I'm able to score an image using a random forest. I haven't tried the other classifiers yet, but will do soon. Thanks! |
Just reporting here that I can successfully use the "Score Image" or "Score All" functions with all of the classifiers using the version after 1ad708d. For reference, the problem arose from having Thanks again! |
This issue has been mentioned on Image.sc Forum. There might be relevant details there: https://forum.image.sc/t/cp-index-error-in-model-file/98446/6 |
From CellProfiler Forum Post:
Hello CPA team!
When using the classifier in CPA I get the following error when trying to score an image using any trained classifier that isn't "Fast Gentle Boosting".
An error occurred in the program:
I also get a similar error when scoring all images, or when trying to fetch positive/negative/uncertain objects. The similarity is in the last 4 lines of the call stack. Looking at the source for cpa/multiclasssql.py, it looks like this try-except calls np.nan_to_num (which is raising the TypeError) once in both the try and except blocks. It may be that cell_data is not getting cleaned up properly before being passed to np.nan_to_num. For example, when np.nan_to_num is called on a numpy array containing a None, the above TypeError gets raised.
I didn't see any issues related to this on the CPA GitHub page so I figured I'd share it here.
I'm on 64-bit Windows 8.1 and using the CPA nightly build. The error also occurs when using the current stable 2.2.1 CPA build.
The text was updated successfully, but these errors were encountered: