-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Can't export activity classifier to CoreML. #2945
Comments
Hi @mecid are you able to share the model you're trying to export? |
@syoutsey I'm not sure that I can share the model, but here is the code which I use to train and export model. ` data = tc.SFrame('data.sframe') train, test = tc.activity_classifier.util.random_split_by_session(data, session_id = 'day', fraction=0.8) metrics = model.evaluate(test) |
I just tried exporting an activity classifier model with 6.0 and it worked for me. @mecid - Can you tell us a bit more about your dataset? Roughly how many row and columns? What are the types of your columns? |
@TobyRoseman my dataset looks like this ` 1,7.49629198749759,1 |
@mecid - thank you for the information. I'm now able to reproduce the issue. This issue seems to be happening when ever there is only one feature column. Something in the Activity Classifier's The easiest way to reproduce this error is to use the HAPT Dataset and the following code: import turicreate as tc
data = tc.load_sframe('./hapt_data.sframe/')
data = data.remove_columns(['acc_y', 'acc_z', 'gyro_x', 'gyro_y', 'gyro_z'])
model = tc.activity_classifier.create(data, session_id='exp_id', target='activity',
prediction_window=50)
model.export_coreml('MyCustomActivityClassifier.mlmodel') |
@TobyRoseman awesome! Do we have any workaround? |
@mecid - for a workaround you could add a column to your dataset which just always has the same constant for each row (i.e. I've tested doing this with the HAPT Dataset. Doing this doesn't seem to affect the test accuracy. I'd recommend you verify that's true for your dataset too. Also you'll need to add the constant column to any prediction calls to your exported CoreML model. |
@TobyRoseman nice, thanks! |
Can't export activity classifier to CoreML. It works well with TuriCreate 5, broken with 6.0.
turicreate.toolkits._main.ToolkitError: Could not export model: validator error: Layer 'features' of type 320 has 1 inputs but expects at least 2.
The text was updated successfully, but these errors were encountered: