Skip to content

TensorFlowLiteC and TensorFlowLiteSelectTfOps expose duplicate symbols on iOS #41876

@psobot

Description

@psobot

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. 🙂

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions