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: TypeError: ufunc 'isinf' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe'' Traceback (most recent call last): File "cpa\classifier.pyc", line 1460, in OnScoreImage File "cpa\classifier.pyc", line 1509, in ScoreImage File "cpa\generalclassifier.pyc", line 78, in FilterObjectsFromClassN File "cpa\multiclasssql.pyc", line 127, in FilterObjectsFromClassN File "cpa\multiclasssql.pyc", line 157, in processData File "numpy\lib\type_check.pyc", line 374, in nan_to_num File "numpy\lib\ufunclike.pyc", line 113, in isposinf
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
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.