tensorflow / swift

Swift for TensorFlow
https://tensorflow.org/swift
Apache License 2.0
6.12k stars 608 forks source link

no such module 'TensorFlow' #380

Closed avinashsai closed 4 years ago

avinashsai commented 4 years ago

OS: Ubuntu 18.04 Error: test.swift:1:8: error: no such module 'TensorFlow' import TensorFlow

I have installed swift 4.2.1 and swift-tensorflow 0.6. However, when I ran test.swift I am getting above error.

BradLarson commented 4 years ago

That's most likely indicating that your paths are set up in such a way that you're getting swift from something other than the Swift for TensorFlow toolchain. The Swift for TensorFlow toolchain has its own version of swift within it, so you need to have your path point to that swift binary instead of the stock 4.2.1 compiler.

Running swift -v with one of our toolchains should show you a version of Swift in the 5.x range (5.2 for the latest nightlies, 5.1 for the 0.6 release toolchain).

ematejska commented 4 years ago

What do you mean that you installed swift 4.2.1 and how are you running swift? The swift-tensorflow-0.6 is a full toolchain that comes with it's own version of the swift compiler. This means that you must run the swift compiler that comes with the tensorflow toolchain.

avinashsai commented 4 years ago

I had the path issue. I resolved it.

Thank you