Skip to content

🔧 Add Apple Silicon (M1) Compatibility — Dependency & API Updates #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

abmallick
Copy link

@abmallick abmallick commented May 20, 2025

Summary
This PR adds support for Apple Silicon by introducing OS-specific TensorFlow dependencies. It also updates the code and dependency versions to work with newer versions of TensorFlow, NumPy, and related libraries.

Changes Made
✅ requirements.txt
Added OS-specific TensorFlow packages:

tensorflow==2.16.2 for Linux
tensorflow-macos==2.16.2 and tensorflow-metal==1.2.0 for macOS ARM64

Updated core libraries:

numpy==1.26.4

tf2onnx==1.16.1

onnx, onnxruntime, scikit-learn, and others to latest compatible versions

✅ models_utils.py
Removed deprecated import:

from keras.utils.layer_utils import count_params

Replaced with direct Keras API:

model.count_params(model.trainable_weights)
model.count_params(model.non_trainable_weights)

Tested On
macOS (Apple Silicon M1)
Linux (Ubuntu x64)

abmallick added 3 commits May 20, 2025 19:25
Make the requirements Apple Silicon M1 compatible
Fix Linux tensorflow version
Fix count_params call to work with tensorflow 2.16.2 keras
@fazenrazen
Copy link

This is awesome!!! wow does it work with the new ST Edge 2.1? And the newer 3.1 version of Model Services?

@abmallick
Copy link
Author

@fazenrazen yes, just tested on Ubuntu as well. Just ensure you are using python 3.10.13.

@abmallick abmallick changed the title 🔧 Add Apple Silicon (M1) Compatibility — Dependency & API Updates #11 🔧 Add Apple Silicon (M1) Compatibility — Dependency & API Updates May 20, 2025
@fazenrazen
Copy link

SUPER COOL thank you very much! Which boards were you deploying to. I am just curious! I have the N6 board and the Mac OS framework is just really great so I was wondering if that everything was possible from the mac computer.

@abmallick
Copy link
Author

I am fairly new to embedded systems, N6 dev kit is my first one xD Got it yesterday and have been trying to get a NN running on it. Let us connect on Discord abmallick#7531

@fazenrazen
Copy link

I am trying to make a discord of all the people working on N6 stuff, i sent you a friend request!!

abmallick added 3 commits May 22, 2025 09:57
Ensure correct api usage for model training
Fix api usage for new tensorflow versions
Update api usage for new tensorflow version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants