Permalink
Switch branches/tags
Nothing to show
Find file Copy path
186 lines (132 sloc) 10.8 KB

Install Swift for TensorFlow

To install Swift for TensorFlow, download one of the packages below and follow the instructions for your operating system. After installation, you can use the full suite of Swift tools, including swift (Swift REPL/interpreter) and swiftc (Swift compiler). See here for more details about using Swift for TensorFlow.

Note:

  • If you want to modify the Swift for TensorFlow source code or build with a custom version of TensorFlow, see here for instructions on building from source.
  • Swift for TensorFlow is an early stage project. It has been released to enable open source development and is not yet ready for general use by machine learning developers.

Pre-built Packages

Packages will be released nightly after automated building is set up.

Download Date (last commit)
Xcode 10 October 17, 2018
Ubuntu 16.04 October 17, 2018
Older Packages

Xcode

Xcode 10

Download
October 13, 2018
October 05, 2018
September 17, 2018
September 10, 2018
September 09, 2018
September 05, 2018
August 31, 2018
August 15, 2018
July 24, 2018
July 19, 2018
July 12, 2018
June 29, 2018

Xcode 9

Download
June 25, 2018
June 22, 2018
June 1, 2018
May 10, 2018
May 3, 2018
April 26, 2018

Xcode (CUDA GPU)

Xcode 10 is required.

Download
August 15, 2018
July 24, 2018

Ubuntu 16.04

Download
October 13, 2018
October 05, 2018
September 17, 2018
September 10, 2018
September 9, 2018
September 5, 2018
August 31, 2018
August 15, 2018
July 24, 2018
July 19, 2018
July 12, 2018
June 29, 2018
June 25, 2018
June 22, 2018
June 1, 2018
May 10, 2018
May 3, 2018
April 26, 2018

Ubuntu 14.04

Download
July 24, 2018
July 19, 2018
July 12, 2018
June 29, 2018
June 25, 2018
June 22, 2018
June 1, 2018
May 10, 2018
May 3, 2018
April 26, 2018

Note: Currently, the Xcode toolchains above only support macOS development. iOS/tvOS/watchOS are not supported.

Using Downloads

macOS

Requirements

  • macOS 10.13.5 or later
  • Xcode 10.0 beta or later

Additional Requirements

  • For GPU toolchains:
    • CUDA Toolkit 9.2
    • CuDNN 7.1
    • An NVIDIA GPU with compute compability 3.5, 6.1 or 7.0

Installation

  1. Download the latest package release.

  2. Run the package installer, which will install an Xcode toolchain into /Library/Developer/Toolchains/.

  3. An Xcode toolchain (.xctoolchain) includes a copy of the compiler, lldb, and other related tools needed to provide a cohesive development experience for working in a specific version of Swift.

  4. Open Xcode’s Preferences, navigate to Components > Toolchains, and select the installed Swift for TensorFlow toolchain.

  5. Xcode uses the selected toolchain for building Swift code, debugging, and even code completion and syntax coloring. You’ll see a new toolchain indicator in Xcode’s toolbar when Xcode is using a Swift toolchain. Select the Xcode toolchain to go back to Xcode’s built-in tools.

Select toolchain in Xcode preferences.

  1. Selecting a Swift toolchain affects the Xcode IDE only. To use the Swift toolchain with command-line tools, add the Swift toolchain to your path as follows:

    $ export PATH=/Library/Developer/Toolchains/swift-latest/usr/bin:"${PATH}"
  2. CUDA-only: If you downloaded a CUDA GPU version of the toolchain, add the library path(s) to CUDA and CuDNN to $LD_LIBRARY_PATH.

    $ export LD_LIBRARY_PATH=/usr/local/cuda/lib:"${LD_LIBRARY_PATH}"

Linux

Packages for Linux are tar archives including a copy of the Swift compiler, lldb, and related tools. You can install them anywhere as long as the extracted tools are in your PATH. Note that nothing prevents Swift from being ported to other Linux distributions beyond the ones mentioned below. These are only the distributions where these binaries have been built and tested.

Requirements

  • Ubuntu 14.04 or 16.04 (64-bit)

Supported Target Platforms

  • Ubuntu 14.04 or 16.04 (64-bit)

Installation

  1. Install required dependencies:
$ sudo apt-get install clang libcurl3 libicu-dev libpython-dev libncurses5-dev
  1. Download the latest binary release above.

The swift-tensorflow-<VERSION>-<PLATFORM>.tar.gz file is the toolchain itself.

  1. Extract the archive with the following command:
$ tar xzf swift-tensorflow-<VERSION>-<PLATFORM>.tar.gz

This creates a usr/ directory in the location of the archive.

  1. Add the Swift toolchain to your path as follows:
$ export PATH=$(pwd)/usr/bin:"${PATH}"

You can now execute the swift command to run the REPL or build Swift projects.