tensorflow: TensorFlowLiteC and TensorFlowLiteSelectTfOps expose duplicate symbols on iOS

System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): macOS 10.15.6
  • Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: iPhone 11 Pro Max
  • TensorFlow installed from (source or binary): binary
  • TensorFlow version: 2.3.0

Describe the problem

When attempting to use TensorFlow Lite on iOS with TensorFlowLiteSelectTfOps as per the documentation, the linker raises an error that it found 17 duplicate symbols for architecture arm64:

duplicate symbol '_TfLiteDelegateCreate' in:
    [...snip...]/Pods/TensorFlowLiteSelectTfOps/Frameworks/TensorFlowLiteSelectTfOps.framework/TensorFlowLiteSelectTfOps(common_1fe599348340cdd31b92895a3a36b237.o)
    [...snip...]/Pods/TensorFlowLiteC/Frameworks/TensorFlowLiteC.framework/TensorFlowLiteC
duplicate symbol '_TfLiteFloatArrayCreate' in:
    [...snip...]/Pods/TensorFlowLiteSelectTfOps/Frameworks/TensorFlowLiteSelectTfOps.framework/TensorFlowLiteSelectTfOps(common_1fe599348340cdd31b92895a3a36b237.o)
    [...snip...]/Pods/TensorFlowLiteC/Frameworks/TensorFlowLiteC.framework/TensorFlowLiteC
duplicate symbol '_TfLiteFloatArrayFree' in:
    [...snip...]/Pods/TensorFlowLiteSelectTfOps/Frameworks/TensorFlowLiteSelectTfOps.framework/TensorFlowLiteSelectTfOps(common_1fe599348340cdd31b92895a3a36b237.o)
    [...snip...]/Pods/TensorFlowLiteC/Frameworks/TensorFlowLiteC.framework/TensorFlowLiteC
duplicate symbol '_TfLiteFloatArrayGetSizeInBytes' in:
    [...snip...]/Pods/TensorFlowLiteSelectTfOps/Frameworks/TensorFlowLiteSelectTfOps.framework/TensorFlowLiteSelectTfOps(common_1fe599348340cdd31b92895a3a36b237.o)
    [...snip...]/Pods/TensorFlowLiteC/Frameworks/TensorFlowLiteC.framework/TensorFlowLiteC
duplicate symbol '_TfLiteIntArrayCopy' in:
    [...snip...]/Pods/TensorFlowLiteSelectTfOps/Frameworks/TensorFlowLiteSelectTfOps.framework/TensorFlowLiteSelectTfOps(common_1fe599348340cdd31b92895a3a36b237.o)
    [...snip...]/Pods/TensorFlowLiteC/Frameworks/TensorFlowLiteC.framework/TensorFlowLiteC
duplicate symbol '_TfLiteIntArrayCreate' in:
    [...snip...]/Pods/TensorFlowLiteSelectTfOps/Frameworks/TensorFlowLiteSelectTfOps.framework/TensorFlowLiteSelectTfOps(common_1fe599348340cdd31b92895a3a36b237.o)
    [...snip...]/Pods/TensorFlowLiteC/Frameworks/TensorFlowLiteC.framework/TensorFlowLiteC
duplicate symbol '_TfLiteIntArrayEqual' in:
    [...snip...]/Pods/TensorFlowLiteSelectTfOps/Frameworks/TensorFlowLiteSelectTfOps.framework/TensorFlowLiteSelectTfOps(common_1fe599348340cdd31b92895a3a36b237.o)
    [...snip...]/Pods/TensorFlowLiteC/Frameworks/TensorFlowLiteC.framework/TensorFlowLiteC
duplicate symbol '_TfLiteIntArrayEqualsArray' in:
    [...snip...]/Pods/TensorFlowLiteSelectTfOps/Frameworks/TensorFlowLiteSelectTfOps.framework/TensorFlowLiteSelectTfOps(common_1fe599348340cdd31b92895a3a36b237.o)
    [...snip...]/Pods/TensorFlowLiteC/Frameworks/TensorFlowLiteC.framework/TensorFlowLiteC
duplicate symbol '_TfLiteIntArrayFree' in:
    [...snip...]/Pods/TensorFlowLiteSelectTfOps/Frameworks/TensorFlowLiteSelectTfOps.framework/TensorFlowLiteSelectTfOps(common_1fe599348340cdd31b92895a3a36b237.o)
    [...snip...]/Pods/TensorFlowLiteC/Frameworks/TensorFlowLiteC.framework/TensorFlowLiteC
duplicate symbol '_TfLiteIntArrayGetSizeInBytes' in:
    [...snip...]/Pods/TensorFlowLiteSelectTfOps/Frameworks/TensorFlowLiteSelectTfOps.framework/TensorFlowLiteSelectTfOps(common_1fe599348340cdd31b92895a3a36b237.o)
    [...snip...]/Pods/TensorFlowLiteC/Frameworks/TensorFlowLiteC.framework/TensorFlowLiteC
duplicate symbol '_TfLiteQuantizationFree' in:
    [...snip...]/Pods/TensorFlowLiteSelectTfOps/Frameworks/TensorFlowLiteSelectTfOps.framework/TensorFlowLiteSelectTfOps(common_1fe599348340cdd31b92895a3a36b237.o)
    [...snip...]/Pods/TensorFlowLiteC/Frameworks/TensorFlowLiteC.framework/TensorFlowLiteC
duplicate symbol '_TfLiteSparsityFree' in:
    [...snip...]/Pods/TensorFlowLiteSelectTfOps/Frameworks/TensorFlowLiteSelectTfOps.framework/TensorFlowLiteSelectTfOps(common_1fe599348340cdd31b92895a3a36b237.o)
    [...snip...]/Pods/TensorFlowLiteC/Frameworks/TensorFlowLiteC.framework/TensorFlowLiteC
duplicate symbol '_TfLiteTensorDataFree' in:
    [...snip...]/Pods/TensorFlowLiteSelectTfOps/Frameworks/TensorFlowLiteSelectTfOps.framework/TensorFlowLiteSelectTfOps(common_1fe599348340cdd31b92895a3a36b237.o)
    [...snip...]/Pods/TensorFlowLiteC/Frameworks/TensorFlowLiteC.framework/TensorFlowLiteC
duplicate symbol '_TfLiteTensorFree' in:
    [...snip...]/Pods/TensorFlowLiteSelectTfOps/Frameworks/TensorFlowLiteSelectTfOps.framework/TensorFlowLiteSelectTfOps(common_1fe599348340cdd31b92895a3a36b237.o)
    [...snip...]/Pods/TensorFlowLiteC/Frameworks/TensorFlowLiteC.framework/TensorFlowLiteC
duplicate symbol '_TfLiteTensorRealloc' in:
    [...snip...]/Pods/TensorFlowLiteSelectTfOps/Frameworks/TensorFlowLiteSelectTfOps.framework/TensorFlowLiteSelectTfOps(common_1fe599348340cdd31b92895a3a36b237.o)
    [...snip...]/Pods/TensorFlowLiteC/Frameworks/TensorFlowLiteC.framework/TensorFlowLiteC
duplicate symbol '_TfLiteTensorReset' in:
    [...snip...]/Pods/TensorFlowLiteSelectTfOps/Frameworks/TensorFlowLiteSelectTfOps.framework/TensorFlowLiteSelectTfOps(common_1fe599348340cdd31b92895a3a36b237.o)
    [...snip...]/Pods/TensorFlowLiteC/Frameworks/TensorFlowLiteC.framework/TensorFlowLiteC
duplicate symbol '_TfLiteTypeGetName' in:
    [...snip...]/Pods/TensorFlowLiteSelectTfOps/Frameworks/TensorFlowLiteSelectTfOps.framework/TensorFlowLiteSelectTfOps(common_1fe599348340cdd31b92895a3a36b237.o)
    [...snip...]/Pods/TensorFlowLiteC/Frameworks/TensorFlowLiteC.framework/TensorFlowLiteC
ld: 17 duplicate symbols for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Provide the exact sequence of commands / steps that you executed before running into the problem

Ran pod install with the following lines in my Podfile, as per documentation:

pod 'TensorFlowLiteObjC'
pod 'TensorFlowLiteSelectTfOps', '~> 0.0.1-nightly.20200729'
use_frameworks!

Attempted to build the app in Xcode.

grep Tensor Podfile.lock returns:

  - TensorFlowLiteC (2.3.0):
    - TensorFlowLiteC/Core (= 2.3.0)
  - TensorFlowLiteC/Core (2.3.0)
  - TensorFlowLiteObjC (2.3.0):
    - TensorFlowLiteC (= 2.3.0)
  - TensorFlowLiteSelectTfOps (0.0.1-nightly.20200729)
  - TensorFlowLiteObjC
  - TensorFlowLiteSelectTfOps (~> 0.0.1-nightly.20200729)
    - TensorFlowLiteC
    - TensorFlowLiteObjC
    - TensorFlowLiteSelectTfOps
  TensorFlowLiteC: 51f50caf5777f740a70e2c1a5dbdc149e7aeb50b
  TensorFlowLiteObjC: 5b358503636cffcbbafd8b0ac9badb577fd72800
  TensorFlowLiteSelectTfOps: eb44f3855f87b50470c70a379777c98aaf13a943

Friendly ping to @yyoon - I see you’ve been active in this code recently and may have some insight. 🙂

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 32 (10 by maintainers)

Most upvoted comments

Hi all, Commit https://github.com/tensorflow/tensorflow/commit/4b6c15218b690c5c75b28c423991096e4f0ea51b contains the fix for this error. You can try to build the master branch or waiting for it to be included in the nightly build tomorrow.

Hi

I am also getting same error. Undefined symbols for architecture arm64: “_uprv_getICUData_conversion”, referenced from: openCommonData(char const*, int, UErrorCode*) in TensorFlowLiteSelectTfOps(udata_2985644a25bfa5ed30c4cd35b64b13bb.o) ld: symbol(s) not found for architecture arm64

Any solution for this.