Skip to content
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

Mhp23 patch 1 #23

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

Mhp23 patch 1 #23

wants to merge 2 commits into from

Conversation

Mhp23
Copy link

@Mhp23 Mhp23 commented Jan 23, 2024

  • Excluded arm64 simulators from the pod
  • Updating docs to run app on iOS simulators

Since the current stable version of TensorFlow Lite doesn't support arm64 simulators, building the app is failing for Apple Silicon (It appears that this issue is resolved in the TensorFlow Lite nightly version). Therefore, in this PR, the arm64 simulator is excluded, and instructions for running the app directly on x86_64 architecture simulators from the command line are added to the documentation.

Mhp23 added 2 commits January 23, 2024 12:24
fix: Excluded arm64 architecture for iPhone simulators on the pod
@mrousavy
Copy link
Owner

Hey - thanks for your PR!

It appears that this issue is resolved in the TensorFlow Lite nightly version

I am building TensorFlow Lite from source from their current main - so if they fixed the issue, it should be resolved.
I did manage to run the example app on a simulator before, are you seeing errors or what was the motivation of this PR?

@Mhp23
Copy link
Author

Mhp23 commented Jan 23, 2024

@mrousavy You're welcome!
Running the app on a physical device is OK, but when I've trying to run the app on a simulator with arm64 architecture, it threw the following errors and for run the app, I had to use Rosetta, and I decided to submit this PR that might be helpful for running the app on simulator with x86_64 architecture on Apple silicon chips. (Additionally, because TF doesn't support arm64 yet I excluded that)

Building for iOS Simulator, but linking in object file built for iOS, file '*/node_modules/react-native-fast-tflite/ios/TensorFlowLiteC.framework/TensorFlowLiteC' for architecture arm64
Linker command failed with exit code 1 (use -v to see invocation)

@mrousavy
Copy link
Owner

mrousavy commented Jan 23, 2024

Ah I see - I think this approach is not really good since it blocks simulators / makes it harder to use on simulators.

I think we can compile TensorFlowLiteC for simulator as well (see build-tensorflow-ios.sh), I don't have any time to look into this right now though.
I'll leave this open for now for reference in the future.

@mrousavy
Copy link
Owner

See #26

@Chasty
Copy link

Chasty commented Jan 23, 2024

Same issue here, why it blocks simulators, I think it'd run in simulator as @Mhp23 mentioned.

@computerjazz
Copy link

I found this tensorflow PR from 2022 that was supposed to enable tflite to build for arm64 simulators: tensorflow/tensorflow#55777

Is it possible we just need to add --config=ios_sim_arm64 to the build script as indicated in that PR?

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.

4 participants