apple / turicreate

Turi Create simplifies the development of custom machine learning models.
BSD 3-Clause "New" or "Revised" License
11.19k stars 1.14k forks source link

Kernel Died when export_coreml #3450

Open shihemimi opened 2 years ago

shihemimi commented 2 years ago

I have trouble exporting the simple model I created for classifying images of my and my cats, the code runs well through saving the model, but every time I try to export the model by "model.export_coreml('me-mimi.mlmodel')" it fails and the kernel stop (error message screenshot below). Does anyone knows why and what I can do to fix it? thanks!

image

import turicreate as tc import os

data = tc.image_analysis.load_images('mimi_me', with_path = True) data['label'] = data['path'].apply(lambda path:'me' if '/me' in path else 'mimi') data.save('me-mimi.sframe') data = tc.SFrame('me-mimi.sframe/') train_set, test_set = data.random_split(0.8) model = tc.image_classifier.create(train_set, target='label') predictions = model.evaluate(test_set) model.save('me-mimi.model') model.export_coreml('me-mimi.mlmodel')

TobyRoseman commented 2 years ago

Does it work if you run the code directly in the terminal? If it does not work in the terminal, do you get a stacktrace or any additional information?

Avinash-Tanniru commented 2 years ago

have you solved it?

shihemimi commented 2 years ago

no I haven't solve it yet, same happen if I run code in terminal. I am using a 14inch M1 MacBook Pro, does it has something to do with this issue?

Avinash-Tanniru commented 2 years ago

yeah, persons who are using M1 getting the same issue

shihemimi commented 2 years ago

is there are workaround or fix available? I am not able to export any ml model created by Turicreate for deployment as of now

TobyRoseman commented 2 years ago

Does the code work when run not from juypter notebook (e.x. from the terminal)?

Please verify your notebook is running using Rosetta. What is the output of the following code?

import os
print(os.system('uname -a'))
shihemimi commented 2 years ago

Hi Toby,

below is the output when I ran "import osprint(os.system('uname -a'))"

Darwin MacBook-Pro 21.5.0 Darwin Kernel Version 21.5.0: Tue Apr 26 21:08:37 PDT 2022; root:xnu-8020.121.3~4/RELEASE_ARM64_T6000 x86_64 0

TobyRoseman commented 2 years ago

Looks like it's running using Rosetta (note the x86_64). So I don't think this is an M1 issue.

Does the code work if ran from the terminal, not from Juypter notebook?

MatheusCavasin commented 2 years ago

I'm having the same problem, has someone fixed it?

ayasinskyi commented 9 months ago

The reason of crash is in TensorFlow. Python 3.8 pulls TensorFlow, which is not built for M processors, that's why it's crashing on exit code 132 (interrupted by signal 4:SIGILL). I managed to run Turi Create only on Mac with Intel chip.