Skip to content
This repository has been archived by the owner on Dec 21, 2023. It is now read-only.

Kernel Died when export_coreml #3450

Open
shihemimi opened this issue Jun 23, 2022 · 10 comments
Open

Kernel Died when export_coreml #3450

shihemimi opened this issue Jun 23, 2022 · 10 comments

Comments

@shihemimi
Copy link

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
Copy link
Collaborator

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
Copy link

have you solved it?

@shihemimi
Copy link
Author

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
Copy link

yeah, persons who are using M1 getting the same issue

@shihemimi
Copy link
Author

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
Copy link
Collaborator

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
Copy link
Author

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
Copy link
Collaborator

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
Copy link

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

@ayasinskyi
Copy link

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants