Swift for TensorFlow

Overview

Swift for TensorFlow (Archived)

Swift for TensorFlow was an experiment in the next-generation platform for machine learning, incorporating the latest research across machine learning, compilers, differentiable programming, systems design, and beyond. It was archived in February 2021. Some significant achievements from this project include:

This site will not receive further updates. The API documentation and binary downloads will continue to be accessible as well as the Open Design Review meeting recordings.

Getting started

Using Swift for TensorFlow

Tutorials

Tutorial Last Updated
A Swift Tour March 2019
Protocol-Oriented Programming & Generics August 2019
Python Interoperability March 2019
Custom Differentiation March 2019
Sharp Edges in Differentiability November 2020
Model Training Walkthrough March 2019
Raw TensorFlow Operators December 2019
Introducing X10, an XLA-Based Backend May 2020

Resources

Forums

The discussions happened on the [email protected] mailing list.

Why Swift for TensorFlow?

Swift for TensorFlow is a new way to develop machine learning models. It gives you the power of TensorFlow directly integrated into the Swift programming language. We believe that machine learning paradigms are so important that they deserve first-class language and compiler support.

A fundamental primitive in machine learning is gradient-based optimization: computing function derivatives to optimize parameters. With Swift for TensorFlow, you can easily differentiate functions using differential operators like gradient(of:), or differentiate with respect to an entire model by calling method gradient(in:). These differentiation APIs are not just available for Tensor-related concepts—they are generalized for all types that conform to the Differentiable protocol, including Float, Double, SIMD vectors, and your own data structures.

// Custom differentiable type.
struct Model: Differentiable {
    var w: Float
    var b: Float
    func applied(to input: Float) -> Float {
        return w * input + b
    }
}

// Differentiate using `gradient(at:_:in:)`.
let model = Model(w: 4, b: 3)
let input: Float = 2
let (𝛁model, 𝛁input) = gradient(at: model, input) { model, input in
    model.applied(to: input)
}

print(𝛁model) // Model.TangentVector(w: 2.0, b: 1.0)
print(𝛁input) // 4.0

Beyond derivatives, the Swift for TensorFlow project comes with a sophisticated toolchain to make users more productive. You can run Swift interactively in a Jupyter notebook, and get helpful autocomplete suggestions to help you explore the massive API surface of a modern deep learning library. You can get started right in your browser in seconds!

Migrating to Swift for TensorFlow is really easy thanks to Swift's powerful Python integration. You can incrementally migrate your Python code over (or continue to use your favorite Python libraries), because you can easily call your favorite Python library with a familiar syntax:

import TensorFlow
import Python

let np = Python.import("numpy")

let array = np.arange(100).reshape(10, 10)  // Create a 10x10 numpy array.
let tensor = Tensor<Float>(numpy: array)  // Seamless integration!

Documentation

Beware: the project is moving very quickly, and thus some of these documents are slightly out of date as compared to the current state-of-the-art.

Overview

Document Last Updated Status
Why Swift for TensorFlow? April 2018 Current
Swift for TensorFlow Design Overview April 2018 Outdated
Supported Backends May 2020 Current

Technology deep dive

The Swift for TensorFlow project builds on top of powerful theoretical foundations. For insight into some of the underlying technologies, check out the following documentation.

Document Last Updated Status
Swift Differentiable Programming Manifesto January 2020 Current
Swift Differentiable Programming Implementation Overview August 2019 Current
Swift Differentiable Programming Design Overview June 2019 Outdated
Differentiable Types March 2019 Outdated
Differentiable Functions and Differentiation APIs March 2019 Outdated
Dynamic Property Iteration using Key Paths March 2019 Current
Hierarchical Parameter Iteration and Optimization March 2019 Current
First-Class Automatic Differentiation in Swift: A Manifesto October 2018 Outdated
Automatic Differentiation Whitepaper April 2018 Outdated
Python Interoperability April 2018 Current
Graph Program Extraction April 2018 Outdated

Source code

Compiler and standard library development happens on the main branch of the apple/swift repository.

Additional code repositories that make up the core of the project include:

Swift for TensorFlow is no longer a fork of the official Swift language; development was previously done on the tensorflow branch of the apple/swift repository. Language additions were designed to fit with the direction of Swift and are going through the Swift Evolution process.

Jupyter Notebook support

Jupyter Notebook support for Swift is under development at google/swift-jupyter.

Model garden

tensorflow/swift-models is a repository of machine learning models built with Swift for TensorFlow. It intended to provide examples of how to use Swift for TensorFlow, to allow for end-to-end tests of machine learning APIs, and to host model benchmarking infrastructure.

SwiftAI

fastai/swiftai is a high-level API for Swift for TensorFlow, modeled after the fastai Python library.

Community

Swift for TensorFlow discussions happen on the [email protected] mailing list.

Bugs reports and feature requests

Before reporting an issue, please check the Frequently Asked Questions to see if your question has already been addressed.

For questions about general use or feature requests, please send an email to the mailing list or search for relevant issues in the JIRA issue tracker.

For the most part, the core team's development is also tracked in JIRA.

Contributing

We welcome contributions from everyone. Read the contributing guide for information on how to get started.

Code of conduct

In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.

The Swift for TensorFlow community is guided by our Code of Conduct, which we encourage everybody to read before participating.

Comments
  • Added a proposal for a high-level design for graph program extraction.

    Added a proposal for a high-level design for graph program extraction.

    This is based on some thoughts I had on this topic and on an offline discussion I had yesterday with @mhong and @alextp. I hope it leads to some interesting discussion. :)

    opened by eaplatanios 22
  • xcode 9.3 code signature verification fails

    xcode 9.3 code signature verification fails

    When I try to verify the code-signature of the swift/TF toolchain, I get an error saying:

    “Swift for TensorFlow Development Snapshot 2018-05-03” does not have a valid signature: code failed to satisfy specified code requirement(s)
    

    See image below

    image

    Any idea how I can resolve this?

    opened by pchalasani 20
  • error: failed to stop process at REPL breakpoint

    error: failed to stop process at REPL breakpoint

    Xcode 9.2 and macOS 10.12.6.

    $ export PATH=/Library/Developer/Toolchains/swift-latest/usr/bin:"${PATH}"
    $ swift
    error: failed to stop process at REPL breakpoint
    

    In xcode playground, I got no output. screen shot 2018-05-06 at 10 35 10

    opened by WongChen 19
  • TensorFlow doesn't work in REPL, Playground and macOS App

    TensorFlow doesn't work in REPL, Playground and macOS App

    Hello! I have problem. I setup latest swift-tensorflow-DEVELOPMENT-2018-05-10-a.xctoolchain, used export PATH=/Library/Developer/Toolchains/swift-latest/usr/bin:"${PATH}" and select on 'Swift for TensorFlow Development Snapshot' and nothing.

    My macOS Playground don't compile: image

    MacOS Cocoa App has crashes: image

    And REPL can't find TensorFlow Module: image

    That my toolchains: image

    And env: image

    What I do wrong? Except programming, of course..

    opened by SpectralDragon 18
  • dyld: Symbol not found: _$sSly7ElementQz5IndexQzcigTq

    dyld: Symbol not found: _$sSly7ElementQz5IndexQzcigTq

    On Mojave, Xcode 10.2, Toolchain 0.3 getting this result for a command-line macOS app -

    dyld: Symbol not found: _$sSly7ElementQz5IndexQzcigTq
      Referenced from: /Library/Developer/Toolchains/swift-tensorflow-RELEASE-0.3-a.xctoolchain/usr/lib/swift/macosx/libswiftPython.dylib
      Expected in: /usr/lib/swift/libswiftCore.dylib
     in /Library/Developer/Toolchains/swift-tensorflow-RELEASE-0.3-a.xctoolchain/usr/lib/swift/macosx/libswiftPython.dylib
    

    I configured the project as described here - https://stackoverflow.com/questions/55782961/swift-for-tensorflow-dyld-symbol-not-found-ssly7elementqz5indexqzcigtq

    opened by maxvol 17
  • Import error.

    Import error.

    Reinstalled several times, but Xcode constantly gives import error. It is impossible to import "TensorFlow", but for some reason sometimes "CTensorFlow" is suggested by Xcode suggestions. 2018-06-06 10 07 42

    Also, in some cases playground just goes in infinite compilation, or works very very slow. What this could be caused by and how may I solve this problems? Thanks in advance.

    Xcode 9.4 macOS 10.13.5

    opened by eldardamirov 17
  • In Xcode has a build error:Array input is not a constant array of tensors

    In Xcode has a build error:Array input is not a constant array of tensors

    code: import TensorFlow let x = Tensor([[1, 2], [3, 4]]) //error:Array input is not a constant array of tensors print(x)

    i have install tensorflow-swift。Xcode Version 9.3 (9E145) and Selected a Swift toolchain affects the Xcode。

    but the same code is ok in Swift REPL

    opened by TuomaXu 16
  • 0.11 cannot build with package manager, 0.10 can

    0.11 cannot build with package manager, 0.10 can

    Hello,

    It looks like s4tf projects cannot build from the command line if they use the package manager in 0.11, but they do work in 0.10.

    This issue is only affecting ubuntu 18.04 LTS, I tried this same project on my mac with 0.11 and it worked ok test_s4tf.zip

    /home/admin2/usr/bin/swift run s4tf_test Fetching https://github.com/httpswift/swifter.git Fetching https://github.com/IBM-Swift/BlueSocket.git Fetching https://github.com/codewinsdotcom/PostgresClientKit Fetching https://github.com/IBM-Swift/BlueSSLService Cloning https://github.com/codewinsdotcom/PostgresClientKit Resolving https://github.com/codewinsdotcom/PostgresClientKit at 1.3.0 Cloning https://github.com/httpswift/swifter.git Resolving https://github.com/httpswift/swifter.git at 4d89ac464d2d3b931cadc4a13696b32b2fd0dd3e Updating https://github.com/httpswift/swifter.git Updating https://github.com/codewinsdotcom/PostgresClientKit Updating https://github.com/IBM-Swift/BlueSSLService Updating https://github.com/IBM-Swift/BlueSocket.git Everything is already up-to-date error: the Package.resolved file is most likely severely out-of-date and is preventing correct resolution; delete the resolved file and try again

    I deleted Package.resolved but it still happens on my ubuntu box. Please let me know if I am missing something obvious or if there is any more info I can provide that will help to isolate this problem.

    Thanks

    opened by rezahussain 14
  • Excluding function arguments from differentiation

    Excluding function arguments from differentiation

    I've gotten stuck at a similar junction a few times. It's where I have a loss function that I'm feeding some stateful data structure, and I want the state of the data as well as the cost at the end. However, the output of the loss function must be a single scalar, so I can't return the state as well. I've been solving it by saving the state off to a global variable (right before return cost) until now, but I need a better solution. I've tried adding an inout argument to loss, but I've failed to exclude it from differentiation with @differentiable(wrt: (only one of the two)) . I still get the compiler error Cannot differentiate functions with both an 'inout' parameter and a result

    So generally, what exactly is the pattern to include and exclude arguments from differentiation, and specifically, is there a better way to solve my state problem than a global variable?

    Thanks!

    opened by porterchild 11
  • Verify Installation Step in Installation instructions fail on Windows

    Verify Installation Step in Installation instructions fail on Windows

    swift test.swift test.swift:1:8: error: missing required module 'CTensorFlow' import TensorFlow ^ with S4TF from 15 April 2020 on Windows 10 Version 1803 (OS Build 17134.1304) Toolchain is installed in C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain

    opened by maxvol 11
  • Source Code for the frameworks for S4TF?  Where are they?

    Source Code for the frameworks for S4TF? Where are they?

    Where are the implementations for the following frameworks?

    Example:

    1. Tensorflow
    2. Datasets
    3. ModelSupport
    4. ImageClassificationModels
    5. Foundation etc.

    Do you put these on Github? How can I drill-down without understanding the capabilities in a transparent way of these custom Swift frameworks for Tensorflow first? All the classes with their data members and functions along with the respective namespaces?

    Thanks in advance!

    opened by shyamalschandra 11
  • Unable to determine Swift version for the following pods

    Unable to determine Swift version for the following pods

    Added the tensorflow library to my custom flutter plugin, within the iOS code the following occurs after adding it to the Podfile `[!] Unable to determine Swift version for the following pods:

    - `TensorFlowLiteSwift-library` does not specify a Swift version and none of
    the targets (`Pods`) integrating it have the `SWIFT_VERSION` attribute set.
    Please contact the author or set the `SWIFT_VERSION` attribute in at least
    one of the targets that integrate this pod.`
    

    I've already tried: target 'Runner' do use_frameworks! use_modular_headers!

    post_install do |installer| installer.pods_project.targets.each do |target| flutter_additional_iso_build_settings(target) target.build_configurations.each do |config| config.build_settings['SWIFT_VERSION'] = '5.0' config.build_settings['ENABLE_BITCODE'] = 'NO' end end

    opened by rayyan808 0
  • Cannot load underlying module for 'Darwin

    Cannot load underlying module for 'Darwin

    I believe this may be happening due to me using Apple Silicon, but I get this error when running: import PythonKit

    error: could not find module 'PythonKit' for target 'arm64-apple-macos'; found: x86_64

    I've tried running with arch -x86-64 but it then says error: cannot load underlying module for 'Darwin'

    Any way around this?

    opened by Aurther-Nadeem 0
  • Errors while switching to stock toolchain

    Errors while switching to stock toolchain

    While switching from the 0.12 S4TF release to a stock toolchain from https://swift.org/download/#releases, I've gotten some compiler errors.

    1. When extending Optional and using TangentVector, the compiler says'TangentVector' is not a member type of 'Optional'. This surprises me. Am I missing something?
    2. When using the KeyPathIterable implementation from swift-apis, I get the error "Cannot find '_forEachFieldWithKeyPath' in scope ", which I thought would be fixed by this PR. I've made sure to use @_spi(Reflection) to import the special function.

    Any help would be appreciated.

    opened by porterchild 9
  • PythonKit error during build: Xcode 12.4, toolchain 0.12

    PythonKit error during build: Xcode 12.4, toolchain 0.12

    I keep hitting an error in PythonKit when trying to build my project using the latest 0.12 toolchain:

    Type referenced from a stored property in a '@frozen' struct must be '@usableFromInline' or public

    Line is: private var pointer: OwnedPyObjectPointer

    Any ideas how to get past it?

    opened by jbmaxwell 3
  • Can't run in macOS SwiftUI App

    Can't run in macOS SwiftUI App

    I'm encountering a runtime error if I try to use TensorFlow in an SwiftUI App:

    dyld: Symbol not found: _$sSo12NSFileHandleC10FoundationE9readToEndAC4DataVSgyKF
      Referenced from: /System/Library/Frameworks/SwiftUI.framework/Versions/A/SwiftUI
      Expected in: /Library/Developer/Toolchains/swift-tensorflow-RELEASE-0.12.xctoolchain/usr/lib/swift/macosx/libswiftFoundation.dylib
     in /System/Library/Frameworks/SwiftUI.framework/Versions/A/SwiftUI
    

    Setup:

    • macOS 11.1
    • Xcode 12.4 and/or Xcode 12.2 Beta 3 (same issue)
    • Swift for TensorFlow 0.12 Release

    Steps to reproduce:

    • Create a new project, chosing macOS and App. Leaving Interface and Life Cycle as default, i.e. SwiftUI.
    • Check the "Disable Library Validation"
    • If using Xcode 12.4, apply fix for "LLDB provided no error string" (#532)
    • Create a new file with the following:
    import TensorFlow
    
    func test() -> String {
        let x = Tensor<Float>([[1, 2], [3, 4]])
        return String(describing: x + x)
    }
    
    • Run (no need to call the function)

    Also, if choosing Command Line Tool instead of App, everything works as expected.

    opened by jonkan 4
  • Unit Tests Pass But tensorflow Produces Non-zero Exit Status

    Unit Tests Pass But tensorflow Produces Non-zero Exit Status

    Swift for Tensorflow 0.12. On an Ubuntu 18.04 machine with CUDA 10.2 installed and a V100 GPU:

    Test Case 'LayerTests.testTransformerOnSineData' passed (9.897 seconds)
    Test Suite 'LayerTests' passed at 2020-12-27 07:46:55.797
             Executed 1 test, with 0 failures (0 unexpected) in 9.897 (9.897) seconds
    Test Suite 'Selected tests' passed at 2020-12-27 07:46:55.797
             Executed 1 test, with 0 failures (0 unexpected) in 9.897 (9.897) seconds
    2020-12-27 07:46:45.834770: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic librar
    y libcudart.so.10.2
    2020-12-27 07:46:45.900244: I tensorflow/core/platform/cpu_feature_guard.cc:142] This TensorFlow binary is optimized with oneA
    PI Deep Neural Network Library (oneDNN)to use the following CPU instructions in performance-critical operations:  SSE3 SSE4.1
    SSE4.2 AVX AVX2 FMA
    To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
    2020-12-27 07:46:45.927378: I tensorflow/core/platform/profile_utils/cpu_utils.cc:104] CPU Frequency: 2199995000 Hz
    2020-12-27 07:46:45.928060: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x55dcd7e22640 initialized for platf
    orm Host (this does not guarantee that XLA will be used). Devices:
    2020-12-27 07:46:45.928091: I tensorflow/compiler/xla/service/service.cc:176]   StreamExecutor device (0): Host, Default Versi
    on
    2020-12-27 07:46:45.929282: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic librar
    y libcuda.so.1
    2020-12-27 07:46:45.938033: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:982] successful NUMA node read from SysFS h
    ad negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
    2020-12-27 07:46:45.942321: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1716] Found device 0 with properties:
    pciBusID: 0000:00:04.0 name: Tesla V100-SXM2-16GB computeCapability: 7.0
    coreClock: 1.53GHz coreCount: 80 deviceMemorySize: 15.78GiB deviceMemoryBandwidth: 836.37GiB/s
    2020-12-27 07:46:45.942365: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic libra$
    y libcudart.so.10.2
    2020-12-27 07:46:45.944454: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic libra$
    y libcublas.so.10
    2020-12-27 07:46:45.946287: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic libra$
    y libcufft.so.10
    2020-12-27 07:46:45.946676: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic libra$
    y libcurand.so.10
    2020-12-27 07:46:45.948799: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic libra$
    y libcusolver.so.10
    2020-12-27 07:46:45.949971: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic libra$
    y libcusparse.so.10
    2020-12-27 07:46:45.954121: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic libra$
    y libcudnn.so.7
    2020-12-27 07:46:45.954209: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:982] successful NUMA node read from SysFS $
    ad negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
    2020-12-27 07:46:46.057140: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:982] successful NUMA node read from SysFS $
    ad negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
    2020-12-27 07:46:46.060045: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1858] Adding visible gpu devices: 0
    2020-12-27 07:46:47.587211: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1257] Device interconnect StreamExecutor with $
    trength 1 edge matrix:
    2020-12-27 07:46:47.587249: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1263]      0
    2020-12-27 07:46:47.587258: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1276] 0:   N
    2020-12-27 07:46:47.587416: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:982] successful NUMA node read from SysFS $
    ad negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
    2020-12-27 07:46:47.588011: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:982] successful NUMA node read from SysFS h
    ad negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
    2020-12-27 07:46:47.588561: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:982] successful NUMA node read from SysFS h
    ad negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
    2020-12-27 07:46:47.589445: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1402] Created TensorFlow device (/job:localhost
    /replica:0/task:0/device:GPU:0 with 13081 MB memory) -> physical GPU (device: 0, name: Tesla V100-SXM2-16GB, pci bus id: 0000:
    00:04.0, compute capability: 7.0)
    2020-12-27 07:46:47.603215: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x55dcee9cc0d0 initialized for platf
    orm CUDA (this does not guarantee that XLA will be used). Devices:
    2020-12-27 07:46:47.603251: I tensorflow/compiler/xla/service/service.cc:176]   StreamExecutor device (0): Tesla V100-SXM2-16G
    B, Compute Capability 7.0
    2020-12-27 07:46:48.270017: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic librar
    y libcublas.so.10
    2020-12-27 07:46:48.635438: I tensorflow/compiler/xla/xla_client/xrt_local_service.cc:54] Peer localservice 1 {localhost:43152
    }
    2020-12-27 07:46:48.635684: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1257] Device interconnect StreamExecutor with s
    trength 1 edge matrix:
    2020-12-27 07:46:48.635706: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1263]
    2020-12-27 07:46:48.641531: I tensorflow/core/distributed_runtime/rpc/grpc_channel.cc:301] Initialize GrpcChannelCache for job
     localservice -> {0 -> localhost:43152}
    2020-12-27 07:46:48.642177: I tensorflow/core/distributed_runtime/rpc/grpc_server_lib.cc:405] Started server with target: grpc
    ://localhost:43152
    2020-12-27 07:46:48.642683: I tensorflow/compiler/xla/xla_client/computation_client.cc:202] NAME: CPU:0
    2020-12-27 07:46:48.642744: I tensorflow/compiler/xla/xla_client/computation_client.cc:202] NAME: GPU:0
    2020-12-27 07:46:55.887941: E tensorflow/stream_executor/stream.cc:338] Error recording event in stream: Error recording CUDA
    event: UNKNOWN ERROR (4); not marking stream as bad, as the Event object may be at fault. Monitor for further errors.
    2020-12-27 07:46:55.887986: E tensorflow/stream_executor/cuda/cuda_event.cc:29] Error polling for event status: failed to quer
    y event: UNKNOWN ERROR (4)
    2020-12-27 07:46:55.888013: F tensorflow/core/common_runtime/gpu/gpu_event_mgr.cc:220] Unexpected Event status: 1
    Exited with signal code 6
    

    On a GitHub Action Ubuntu 18.04 machine with no GPU and no CUDA installed, I get this non-zero exit:

    2020-12-27T16:28:57.6788801Z [50/50] Testing myModelTests.LayerTests/testTransformerOnSineMaskedData
    2020-12-27T16:28:57.6790043Z 
    2020-12-27T16:28:57.6791357Z Test Suite 'Selected tests' started at 2020-12-27 16:26:06.614
    2020-12-27T16:28:57.6792343Z Test Suite 'LayerTests' started at 2020-12-27 16:26:06.616
    2020-12-27T16:28:57.6793517Z Test Case 'LayerTests.testSimpleTransformer' started at 2020-12-27 16:26:06.616
    2020-12-27T16:28:57.6797957Z 2020-12-27 16:26:06.578054: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library 'libcudart.so.10.2'; dlerror: libcudart.so.10.2: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /home/runner/work/my_model/my_model/swift-tensorflow-RELEASE-0.12-cuda10.2-cudnn7-ubuntu18.04/usr/lib/swift/linux
    2020-12-27T16:28:57.6800499Z 2020-12-27 16:26:06.578121: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
    2020-12-27T16:28:57.6802383Z 2020-12-27 16:26:06.617073: I tensorflow/core/platform/cpu_feature_guard.cc:142] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN)to use the following CPU instructions in performance-critical operations:  SSE3 SSE4.1 SSE4.2 AVX AVX2 AVX512F FMA
    2020-12-27T16:28:57.6803875Z To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
    2020-12-27T16:28:57.6806374Z 2020-12-27 16:26:06.617347: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library 'libcuda.so.1'; dlerror: libcuda.so.1: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /home/runner/work/my_model/my_model/swift-tensorflow-RELEASE-0.12-cuda10.2-cudnn7-ubuntu18.04/usr/lib/swift/linux
    2020-12-27T16:28:57.6808661Z 2020-12-27 16:26:06.617366: W tensorflow/stream_executor/cuda/cuda_driver.cc:312] failed call to cuInit: UNKNOWN ERROR (303)
    2020-12-27T16:28:57.6810094Z 2020-12-27 16:26:06.617386: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:156] kernel driver does not appear to be running on this host (fv-az195-301): /proc/driver/nvidia/version does not exist
    2020-12-27T16:28:57.6811413Z 2020-12-27 16:26:06.635039: I tensorflow/core/platform/profile_utils/cpu_utils.cc:104] CPU Frequency: 2593905000 Hz
    2020-12-27T16:28:57.6813825Z 2020-12-27 16:26:06.635207: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x562fed07dfb0 initialized for platform Host (this does not guarantee that XLA will be used). Devices:
    2020-12-27T16:28:57.6815423Z 2020-12-27 16:26:06.635217: I tensorflow/compiler/xla/service/service.cc:176]   StreamExecutor device (0): Host, Default Version
    2020-12-27T16:28:57.6816130Z Exited with signal code 11
    2020-12-27T16:28:57.6816402Z 
    2020-12-27T16:28:57.6816993Z Test Suite 'Selected tests' started at 2020-12-27 16:27:32.332
    2020-12-27T16:28:57.6817716Z Test Suite 'LayerTests' started at 2020-12-27 16:27:32.334
    2020-12-27T16:28:57.6818826Z Test Case 'LayerTests.testSingleIterationLayerChanges' started at 2020-12-27 16:27:32.334
    2020-12-27T16:28:57.6821626Z 2020-12-27 16:27:32.279131: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library 'libcudart.so.10.2'; dlerror: libcudart.so.10.2: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /home/runner/work/my_model/my_model/swift-tensorflow-RELEASE-0.12-cuda10.2-cudnn7-ubuntu18.04/usr/lib/swift/linux
    2020-12-27T16:28:57.6824100Z 2020-12-27 16:27:32.279195: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
    2020-12-27T16:28:57.6825977Z 2020-12-27 16:27:32.334431: I tensorflow/core/platform/cpu_feature_guard.cc:142] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN)to use the following CPU instructions in performance-critical operations:  SSE3 SSE4.1 SSE4.2 AVX AVX2 AVX512F FMA
    2020-12-27T16:28:57.6827452Z To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
    2020-12-27T16:28:57.6829957Z 2020-12-27 16:27:32.334723: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library 'libcuda.so.1'; dlerror: libcuda.so.1: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /home/runner/work/my_model/my_model/swift-tensorflow-RELEASE-0.12-cuda10.2-cudnn7-ubuntu18.04/usr/lib/swift/linux
    2020-12-27T16:28:57.6832230Z 2020-12-27 16:27:32.334742: W tensorflow/stream_executor/cuda/cuda_driver.cc:312] failed call to cuInit: UNKNOWN ERROR (303)
    2020-12-27T16:28:57.6833640Z 2020-12-27 16:27:32.334760: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:156] kernel driver does not appear to be running on this host (fv-az195-301): /proc/driver/nvidia/version does not exist
    2020-12-27T16:28:57.6835179Z 2020-12-27 16:27:32.358841: I tensorflow/core/platform/profile_utils/cpu_utils.cc:104] CPU Frequency: 2593905000 Hz
    2020-12-27T16:28:57.6836636Z 2020-12-27 16:27:32.359025: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x558117e71fb0 initialized for platform Host (this does not guarantee that XLA will be used). Devices:
    2020-12-27T16:28:57.6838026Z 2020-12-27 16:27:32.359035: I tensorflow/compiler/xla/service/service.cc:176]   StreamExecutor device (0): Host, Default Version
    2020-12-27T16:28:57.6838755Z Exited with signal code 11
    2020-12-27T16:28:57.6853361Z ##[error]Process completed with exit code 1.
    

    I see this on most runs of my 50 unit tests. This is a problem because my CI builds are being marked as failed when in fact all the tests are passing.

    Has anyone encountered this on the continuous integration testing of Swift for Tensorflow projects?

    I didn't encounter this on Swift for Tensorflow 0.11.

    opened by xanderdunn 7
Swift for TensorFlow

Swift for TensorFlow (Archived) Swift for TensorFlow was an experiment in the next-generation platform for machine learning, incorporating the latest

null 6.1k Dec 31, 2022
BetterMood is an iOS app that uses Tensorflow to recognize user’s emotions

BetterMood is an iOS app that uses Tensorflow to recognize user’s emotions, convert it into categories then send via our api along with the user’s date of birth and name, to end up with a emotion analyse and horoscope prediction.

Yosri 2 Sep 30, 2021
Easily craft fast Neural Networks on iOS! Use TensorFlow models. Metal under the hood.

Bender Bender is an abstraction layer over MetalPerformanceShaders useful for working with neural networks. Contents Introduction Why did we need Bend

xmartlabs 1.7k Dec 24, 2022
Flutter Piano Audio Detection implemented with Tensorflow Lite Model (Google Magenta)

FlutterPianoAudioDetection Plugin Flutter Piano Audio Detection implemented with Tensorflow Lite Model (Google Magenta) Android Implementation iOS/iPa

WonyJeong 27 Dec 29, 2022
[yolov5] + [ios] + [tensorflow lite]

YOLOv5 - TensorFlow Lite Object Detection iOS Example Application iOS Versions Supported: iOS 12.0 and above. Xcode Version Required: 10.0 and above O

Inpyo Hong 14 Dec 12, 2022
Models and examples built with TensorFlow

Welcome to the Model Garden for TensorFlow The TensorFlow Model Garden is a repository with a number of different implementations of state-of-the-art

null 74.9k Dec 29, 2022
🤗 Transformers: State-of-the-art Machine Learning for Pytorch, TensorFlow, and JAX.

English | 简体中文 | 繁體中文 | 한국어 State-of-the-art Machine Learning for JAX, PyTorch and TensorFlow ?? Transformers provides thousands of pretrained models

Hugging Face 77.1k Dec 31, 2022
Pose Estimation on iOS with TensorFlow Lite

This project is Pose Estimation on iOS with TensorFlow Lite. If you are interested in iOS + Machine Learning, visit here you can see various DEMOs. 2D

tucan9389 125 Nov 28, 2022
A Swift library for creating and exporting CoreML Models in Swift

SwiftCoreMLTools A Swift Library for creating CoreML models in Swift. Work in progress This library expose a (function builder based) DSL as well as a

Jacopo Mangiavacchi 140 Dec 5, 2022
Accelerated tensor operations and dynamic neural networks based on reverse mode automatic differentiation for every device that can run Swift - from watchOS to Linux

DL4S provides a high-level API for many accelerated operations common in neural networks and deep learning. It furthermore has automatic differentiati

Palle 87 Dec 29, 2022
The Swift machine learning library.

Swift AI is a high-performance deep learning library written entirely in Swift. We currently offer support for all Apple platforms, with Linux support

Swift AI 5.9k Jan 2, 2023
BrainCore is a simple but fast neural network framework written in Swift.

BrainCore is a simple but fast neural network framework written in Swift. It uses Metal which makes it screamin' fast. If you want to see it

Alejandro Isaza 377 Jun 29, 2022
MLKit is a simple machine learning framework written in Swift.

MLKit (a.k.a Machine Learning Kit) ?? MLKit is a simple machine learning framework written in Swift. Currently MLKit features machine learning algorit

Guled 152 Nov 17, 2022
Matft is Numpy-like library in Swift. Function name and usage is similar to Numpy.

Numpy-like library in swift. (Multi-dimensional Array, ndarray, matrix and vector library)

null 80 Dec 21, 2022
A simple Swift package which acts as an OpenAI client for the GPT-3 API.

SwiftyGPT3 A simple Swift package which acts as an OpenAI client for GPT-3 brought to you by the Airgift Crew. Supports GPT-3 Codex! Requirements iOS

Airgift 23 Dec 25, 2022
Artificial intelligence/machine learning data structures and Swift algorithms for future iOS development. bayes theorem, neural networks, and more AI.

Swift Brain The first neural network / machine learning library written in Swift. This is a project for AI algorithms in Swift for iOS and OS X develo

Vishal 331 Oct 14, 2022
A toolbox of AI modules written in Swift: Graphs/Trees, Support Vector Machines, Neural Networks, PCA, K-Means, Genetic Algorithms

AIToolbox A toolbox of AI modules written in Swift: Graphs/Trees, Linear Regression, Support Vector Machines, Neural Networks, PCA, KMeans, Genetic Al

Kevin Coble 776 Dec 18, 2022
A framework for building fast genetic algorithms in Swift.

Revolver is a framework for building fast genetic algorithms in Swift 3.0. Features Chromosomes: strings, trees Genetic operators: reproduction, mutat

Petr Mánek 27 Nov 17, 2022
A Swift deep learning library with Accelerate and Metal support.

Serrano Aiming to offering popular and cutting edge techs in deep learning area on iOS devices, Serrano is developed as a tool for developers & resear

pcpLiu 51 Nov 17, 2022