Luke
Luke

Reputation: 35

Swift for TensorFlow - dyld: Symbol not found: _$sSly7ElementQz5IndexQzcigTq

I'm trying to work through the model training workflow tutorial (https://www.tensorflow.org/swift/tutorials/model_training_walkthrough) but when running the code (it's a MacOS app) in Xcode 10.2 (on MacOS 10.14.4 ) I get the following error:

dyld: Symbol not found: _$sSly7ElementQz5IndexQzcigTq Referenced from: /Users/Luke/Library/Developer/Xcode/DerivedData/ANN-ffxhvyujcitzkqfhbrwqjnpftijw/Build/Products/Debug/ANN.app/Contents/MacOS/../Frameworks/libswiftPython.dylib Expected in: /usr/lib/swift/libswiftCore.dylib in /Users/Luke/Library/Developer/Xcode/DerivedData/ANN-ffxhvyujcitzkqfhbrwqjnpftijw/Build/Products/Debug/ANN.app/Contents/MacOS/../Frameworks/libswiftPython.dylib

I've followed the official installation instructions (https://github.com/tensorflow/swift/blob/master/Installation.md):

  1. Downloaded the latest release "swift-tensorflow-RELEASE-0.2"
  2. Run the installer
  3. Set the toolchain to "Swift for TensorFlow Release 0.2" created 02/03/2019
  4. Set the Build System for shared and per-user to Legacy Build System
  5. Set Swift Compiler - Code Generation -> Optimization Level to Optimise for Speed [-0]
  6. added libtensorflow_framework.so and libtensorflow.so to Linked Frameworks
  7. Added "/Library/Developer/Toolchains/swift-tensorflow-RELEASE-0.2.xctoolchain/usr/lib/swift/macosx to Runpath Search Paths. $(inherited) and @executable_path/../Frameworks were already present in the list
  8. added -lpython to Other Linker Flags

Upvotes: 1

Views: 969

Answers (1)

boertjieSeun
boertjieSeun

Reputation: 1

I found this to be quite helpful: https://github.com/tensorflow/swift/blob/master/Usage.md#mac-only-xcode

On macOS Catalina, Verify Code Signature for Swift for TensorFlow toolchains produces a code signature error. This prevents Xcode projects built using Swift for TensorFlow toolchains from running. To work around this issue, go to Project Target Settings > Signing & Capabilities > + Capability > Hardened Runtime and check Disable Library Validation.

Upvotes: 0

Related Questions