Open znation opened 6 years ago
I see this too. Thanks for the workaround!
Faced the same error. I was able to resolve it by using float64 numpy array
input_array.astype(np.float64)
I'm fairly certain I read that CoreML has a max precision of 32. I had a PyTorch model that had input types of type long
or torch.int64
. Trying to call the predict() method on my mlmodel raised this error. My solution was to cast to type np.int32
when calling predict:
y = model.predict('one_hot': one_hot_array.astype(np.int32))
Doing so solved my issue
With coremltools 6.0, the predict
call from the original code now hangs.
float arithmetic might be wrong in some cases with large integer values (e.g. time series)
+1 seems like this is still an issue?
Repro steps:
Expected: something like
Actual:
Note that changing the input to
[1.0, 2, 3]
seems to fix the issue; so despite the multiArrayType being INT32, it only seems to allow float input (at least in some cases).