Giter Site home page Giter Site logo

Comments (12)

znation avatar znation commented on July 20, 2024 1

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.

from turicreate.

znation avatar znation commented on July 20, 2024

@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}}

from turicreate.

johnlev avatar johnlev commented on July 20, 2024

Oh, Python is not the problem. Running it with coremltools works fine, but importing into an Xcode project is where it fails to predict

from turicreate.

znation avatar znation commented on July 20, 2024

Interesting. Let me see if I can repro the issue there.

from turicreate.

znation avatar znation commented on July 20, 2024

@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:

▿ repro.ModelOutput #0
  - room: 3
  ▿ roomProbability: 2 key/value pairs
    ▿ (2 elements)
      - key: 3
      - value: 0.5
    ▿ (2 elements)
      - key: 4
      - value: 0.5

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.

from turicreate.

johnlev avatar johnlev commented on July 20, 2024

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?

from turicreate.

znation avatar znation commented on July 20, 2024

@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 .txt file here so I can reproduce the issue? Thanks!

from turicreate.

johnlev avatar johnlev commented on July 20, 2024

Sure:
all2.txt

from turicreate.

znation avatar znation commented on July 20, 2024

Thanks @johnlev, I'm able to reproduce the issue with the model trained on all2.txt. I'm not sure yet what the cause is but I'm able to see that this model gives predictions in Python but gives errors when called from Swift. I'll investigate further.

from turicreate.

johnlev avatar johnlev commented on July 20, 2024

I might be confused, but after upgrading to 4.1, regenerating the mlmodel, and replacing it in my project, I am still experiencing the same error:

screen shot 2018-02-08 at 5 24 37 pm

from turicreate.

johnlev avatar johnlev commented on July 20, 2024

Thanks @znation. Looking forward to using Turicreate in my project once this is done

from turicreate.

srikris avatar srikris commented on July 20, 2024

@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

sf.column_names()
['\xef\xbb\xbfb1', 'b2', 'b3', 'b4', 'b5', 'room']

The simplest work around is for you to remove the marker from the file which you can do with a simple sed script.

awk 'NR==1{sub(/^\xef\xbb\xbf/,"")}1' all2.txt > all2_byte_ordered.txt

We will be fixing the underlying issue in #227. Hopefully that should unblock you to use Turi Create in your application.

from turicreate.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.