Not Able to Import Tensorflow for Swift in Xcode


(gnanasekar) #1

Hello All,

I am a newbie to Swift came for your help.

Here is my question!!

I'm trying to use Swift for TensorFlow and have followed the directions found here: https://github.com/tensorflow/swift/blob/master/Installation.md

When I go ahead and import TensorFlow as such within a Swift Playground file:

import TensorFlow
I get this error: "The active toolchain is not compatible with playgrounds.libswiftCore.dylib could not be loaded"

I was able to use Swift for tensorflow within the REPL so I know it should work. Does anyone have any ideas on how to fix this issue?


(Tony Y) #2

Use a macOS playground.


(Chris Lattner) #3

Hi @gnanasekar, as Tony-Y says, it is most likely because you're using an iOS playground instead of a Mac playground. Please give that a try. More generally, I'd recommend you ask on the Swift for TensorFlow mailing list, because you'll get more people in the loop there.

Thanks!

-Chris