-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Core ML: Predicted feature named '___' was not output by pipeline #61
Comments
@johnlev Could you please provide detailed steps to reproduce the issue? I tried with the following steps, with synthetic data based on what you pasted above: repro.txt # Create the model
import turicreate as tc
sf = tc.SFrame.read_csv('repro.txt')
model = tc.boosted_trees_classifier.create(sf, target='room')
model.export_coreml("Model.mlmodel") # Make predictions
import coremltools
model = coremltools.models.MLModel('Model.mlmodel')
model.predict({'b1': 1, 'b2': 2, 'b3': 3, 'b4': 4, 'b5': 5}) Gives output with no error: {u'room': 3L, u'roomProbability': {3L: 0.5, 4L: 0.5}} |
Oh, Python is not the problem. Running it with coremltools works fine, but importing into an Xcode project is where it fails to predict |
Interesting. Let me see if I can repro the issue there. |
@johnlev I'm still unable to repro. In Swift in Xcode, I tried the following: let model = Model()
let output = try! model.prediction(b1: 1, b2: 3, b3: 43, b4: 2, b5: 10)
dump(output) And it gives me:
What version of Xcode are you using, and what version of macOS are you running? It's possible this bug is specific to a particular version. |
I am on 10.13.2 using Xcode 9.2. I tried using your repro.txt and it worked just fine, but using the same code but with the expanded dataset I again encountered the error. Any reason you rounded the numbers in repro.txt? |
@johnlev Interesting, I see! Not sure when or how the numbers got rounded (somewhere in copy/paste the way I made a CSV) but I doubt that would affect it. Can you by any chance share your full training data (or a subset of it that also results in the same issue), in CSV format, as a |
Sure: |
Thanks @johnlev, I'm able to reproduce the issue with the model trained on |
Thanks @johnlev, looks like this did not in fact get fixed in 4.1. Sorry for the miscommunication. I'll reopen and we'll make sure the fix gets into 4.2. |
Thanks @znation. Looking forward to using Turicreate in my project once this is done |
@johnlev We have traced down the bug to the presence of a byte-ordered mark in your file. This is corrupting the read_csv of SFrame resulting in columns that contain non-ascii characters
The simplest work around is for you to remove the marker from the file which you can do with a simple sed script.
We will be fixing the underlying issue in #227. Hopefully that should unblock you to use Turi Create in your application. |
I successfully exported a Boosted Trees Classifier model to a Core ML model and imported it into a Xcode project. All seemed well until I tried using it in Swift. Whenever I run the predict function (even with valid inputs) I receive an error: "Predicted feature named 'room' was not output by pipeline" where room is my target name. Is this a Core ML issue or did I export it wrong from Turi Create?
For context, the top 10 lines of the SFrame:
The text was updated successfully, but these errors were encountered: