Reputation: 302
I am an iOS
developer and trying to learn tensorflow
for my Xcode 11.2.1
. I tried installing tensorflow using this link
I got the package in Xcode toolchain.
But after installation when I verified installation, it failed. Swift playground is giving error
No such module 'TensorFlow'
I created a new SwiftPlayground for macOS, still, no avail.
Later I again installed tensorflow through command-line from here and it too was successful.
This time I had created a normal swift file to verify installation, but this too failed.
There is an existing old question on same issue, but that has not been helpful to me. Can anyone help me knows solution to this?
Upvotes: 0
Views: 860
Reputation:
Also, if you, as an iOS developer, want to deploy a model into an iOS app without "leaving Xcode (almost)", you may be able to replicate what this developer did here. The author of that PDF presented at a S4TF design meeting not long ago. You may have seen this in the Google Groups discussion.
A workaround for model saving for you could be: use Python interop > import Keras > ... > Save model as .h5
. Then, perhaps, you could use Apple's Python-based coremltools
for Keras to integrate the model—now in the .mlmodel
format— into your iOS app. I haven't tested this yet.
Upvotes: 0
Reputation: 127
Answers to your queries:
export PATH=/Library/Developer/Toolchains/{swift-toolchain}/usr/bin/"${PATH}"
where you should replace {swift-toolchain}
with your S4TF toolchain name (clicking tab will suggest you available toolchains on your system). Then running swift test.swift
will be (hopefully) successful.Note: S4TF is still in early stage of development & is ready for beginners and researchers to work with it. But I personally feel that if you're developing an app for iOS it's a little early. I hope Apple with announce this feature in WWDC either in 2020 or 2021.
I hope this was helpful!
-- Rahul Bhalley
Upvotes: 2