Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Mac M2 using turicreate module: zsh: illegal hardware instruction error. Help, I've been working on it for 2 weeks and still haven't solved it

I use : Mac 2022 M2 MacBook

Python : 3.6.3


This is my code

import turicreate as tc
image_folder = 'image1/test'
data = tc.image_analysis.load_images(image_folder, with_path=True)
data['label'] = data['path'].apply (lambda path: 'D_4015' if 'D_4015' in path   else 'DB_013')
data.save('diller.sframe')
train_data, test_data = data.random_split(0.8, seed=2)
model = tc.image_classifier.create(train_data, target='label')
predictions = model.predict(test_data)
metrics = model.evaluate(test_data)
model.export_coreml('diller.mlmodel')


bug code

zsh: illegal hardware instruction  /Users/kunhua/Documents/python/demo_turicreate/venv/bin/python


picture:


How can I solve this problem?


This is turicreate gituhub website:

https://github.com/apple/turicreate


I don't understand why Apple's code can't be used on Apple computers






MacBook Pro 13″, macOS 12.6

Posted on Oct 23, 2022 2:22 AM

Reply
5 replies

Oct 23, 2022 8:35 AM in response to 琨华

For as long as we have been using complier-code (not just hand coded assembly-language) illegal instructions are vanishingly un-likely to be generated, and even less likely to be executed.


The cause of illegal instruction execution from compiler code is almost always Hardware -- RAM memory errors.


MacOS slightly randomizes the load point of major modules at each Restart.

If your problem is either fixed or changed by a Restart, that SUPPORTS the suggestion that this is a RAM memory error.

Oct 23, 2022 12:54 PM in response to 琨华

琨华 wrote:

I don't understand why Apple's code can't be used on Apple computers

On the Github page, it states:


Turi Create requires:

• Python 2.7, 3.5, 3.6, 3.7, 3.8
• x86_64 architecture
• At least 4 GB of RAM


And the project doesn't seem to be active anymore.


This kind of code isn't a standalone app like you might download. I checked the issues on GitHub and apparently it doesn't support Apple Silicon at all. If you can get it to work, you may have to run an x86 version of Python via Rosetta. Even then, it probably isn't going to have GPU support. It's going to be very slow. I recommend you find some other solution. This one is a dead end.

Mac M2 using turicreate module: zsh: illegal hardware instruction error. Help, I've been working on it for 2 weeks and still haven't solved it

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.