Not Able to Import Tensorflow for Swift in Xcode

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: swift/Installation.md at main · tensorflow/swift · GitHub

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?

1 Like

Use a macOS playground.

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