我正在爲ios編譯tensorflow,並按照https://github.com/tensorflow/tensorflow/tree/master/tensorflow/contrib/makefile1的說明操作。Tensorflow:ios編譯錯誤(重複符號)
我能順利通過前兩個步驟:
sh tensorflow/contrib/makefile/download_dependencies.sh
sh tensorflow/contrib/makefile/compile_ios_protobuf.sh
但是,我得到了重複的符號錯誤?當我跑
make -f tensorflow/contrib/makefile/Makefile \
TARGET=IOS \
IOS_ARCH=ARM64
任何人都可以幫忙嗎?感謝
下面是錯誤:
~/Documents/Projects/tensorflow/tensorflow/contrib/makefile/gen/lib/ios_ARM64/libtensorflow-core.a -arch arm64
-miphoneos-version-min=9.2 -framework Accelerate -Xlinker -S -Xlinker -x -Xlinker -dead_strip -all_load
L ~/Documents/Projects/tensorflow/tensorflow/contrib/makefile/gen/protobuf_ios/lib -lz -lstdc++ -lprotobuf -lz -lm
duplicate symbol __ZN10tensorflow7NodeDef10SharedDtorEv in:
~/Documents/Projects/tensorflow/tensorflow/contrib/makefile/gen/lib/ios_ARM64/libtensorflow-core.a(node_def.pb.o)
duplicate symbol __ZN10tensorflow7NodeDef10SharedCtorEv in:
~/Documents/Projects/tensorflow/tensorflow/contrib/makefile/gen/lib/ios_ARM64/libtensorflow-core.a(node_def.pb.o)
duplicate symbol __ZN10tensorflow7NodeDef5ClearEv in:
~/Documents/Projects/tensorflow/tensorflow/contrib/makefile/gen/lib/ios_ARM64/libtensorflow-core.a(node_def.pb.o)
duplicate symbol __ZN10tensorflow72protobuf_ShutdownFile_tensorflow_2fcore_2fframework_2fnode_5fdef_2eprotoEv in:
~/Documents/Projects/tensorflow/tensorflow/contrib/makefile/gen/lib/ios_ARM64/libtensorflow-core.a(node_def.pb.o)
duplicate symbol __ZN10tensorflow70protobuf_AssignDesc_tensorflow_2fcore_2fframework_2fnode_5fdef_2eprotoEv
in: ~/Documents/Projects/tensorflow/tensorflow/contrib/makefile/gen/lib/ios_ARM64/libtensorflow-core.a(node_def.pb.o)
duplicate symbol __ZN10tensorflow67protobuf_AddDesc_tensorflow_2fcore_2fframework_2fnode_5fdef_2eprotoEv in:
~/Documents/Projects/tensorflow/tensorflow/contrib/makefile/gen/lib/ios_ARM64/libtensorflow-core.a(node_def.pb.o)
duplicate symbol __ZNK10tensorflow7NodeDef8ByteSizeEv in:
~/Documents/Projects/tensorflow/tensorflow/contrib/makefile/gen/lib/ios_ARM64/libtensorflow-core.a(node_def.pb.o)
duplicate symbol __ZN10tensorflow7NodeDef16default_instanceEv in:
~/Documents/Projects/tensorflow/tensorflow/contrib/makefile/gen/lib/ios_ARM64/libtensorflow-core.a(node_def.pb.o)
duplicate symbol __ZN10tensorflow7NodeDef21InitAsDefaultInstanceEv in:
~/Documents/Projects/tensorflow/tensorflow/contrib/makefile/gen/lib/ios_ARM64/libtensorflow-core.a(node_def.pb.o)
duplicate symbol __ZNK10tensorflow7NodeDef13IsInitializedEv in:
~/Documents/Projects/tensorflow/tensorflow/contrib/makefile/gen/lib/ios_ARM64/libtensorflow-core.a(node_def.pb.o)
duplicate symbol __ZNK10tensorflow7NodeDef11GetMetadataEv in:
~/Documents/Projects/tensorflow/tensorflow/contrib/makefile/gen/lib/ios_ARM64/libtensorflow-core.a(node_def.pb.o)
duplicate symbol __ZN10tensorflow7NodeDefD2Ev in:
~/Documents/Projects/tensorflow/tensorflow/contrib/makefile/gen/lib/ios_ARM64/libtensorflow-core.a(node_def.pb.o)
duplicate symbol __ZN10tensorflow7NodeDefC2Ev in:
~/Documents/Projects/tensorflow/tensorflow/contrib/makefile/gen/lib/ios_ARM64/libtensorflow-core.a(node_def.pb.o)
duplicate symbol __ZN10tensorflow7NodeDefD1Ev in:
~/Documents/Projects/tensorflow/tensorflow/contrib/makefile/gen/lib/ios_ARM64/libtensorflow-core.a(node_def.pb.o)
duplicate symbol __ZN10tensorflow7NodeDefC1Ev in:
~/Documents/Projects/tensorflow/tensorflow/contrib/makefile/gen/lib/ios_ARM64/libtensorflow-core.a(node_def.pb.o)
duplicate symbol __ZN10tensorflow7NodeDefD0Ev in:
~/Documents/Projects/tensorflow/tensorflow/contrib/makefile/gen/lib/ios_ARM64/libtensorflow-core.a(node_def.pb.o)
duplicate symbol __ZNK10tensorflow7NodeDef13SetCachedSizeEi in:
~/Documents/Projects/tensorflow/tensorflow/contrib/makefile/gen/lib/ios_ARM64/libtensorflow-core.a(node_def.pb.o)
duplicate symbol __ZNK10tensorflow7NodeDef39InternalSerializeWithCachedSizesToArrayEbPh in:
~/Documents/Projects/tensorflow/tensorflow/contrib/makefile/gen/lib/ios_ARM64/libtensorflow-core.a(node_def.pb.o)
duplicate symbol __ZN10tensorflow7NodeDef8CopyFromERKS0_ in:
~/Documents/Projects/tensorflow/tensorflow/contrib/makefile/gen/lib/ios_ARM64/libtensorflow-core.a(node_def.pb.o)
duplicate symbol __ZN10tensorflow7NodeDef9MergeFromERKS0_ in:
~/Documents/Projects/tensorflow/tensorflow/contrib/makefile/gen/lib/ios_ARM64/libtensorflow-core.a(node_def.pb.o)
duplicate symbol __ZN10tensorflow7NodeDefC2ERKS0_ in:
~/Documents/Projects/tensorflow/tensorflow/contrib/makefile/gen/lib/ios_ARM64/libtensorflow-core.a(node_def.pb.o)
duplicate symbol __ZN10tensorflow7NodeDefC1ERKS0_ in:
~/Documents/Projects/tensorflow/tensorflow/contrib/makefile/gen/lib/ios_ARM64/libtensorflow-core.a(node_def.pb.o)
duplicate symbol __ZNK10tensorflow7NodeDef24SerializeWithCachedSizesEPN6google8protobuf2io17CodedOutputStreamE in:
~/Documents/Projects/tensorflow/tensorflow/contrib/makefile/gen/lib/ios_ARM64/libtensorflow-core.a(node_def.pb.o)
duplicate symbol __ZN10tensorflow7NodeDef27MergePartialFromCodedStreamEPN6google8protobuf2io16CodedInputStreamE in:
~/Documents/Projects/tensorflow/tensorflow/contrib/makefile/gen/lib/ios_ARM64/libtensorflow-core.a(node_def.pb.o)
duplicate symbol __ZTVN10tensorflow7NodeDefE in:
~/Documents/Projects/tensorflow/tensorflow/contrib/makefile/gen/lib/ios_ARM64/libtensorflow-core.a(node_def.pb.o)
duplicate symbol __ZTSN10tensorflow7NodeDefE in:
~/Documents/Projects/tensorflow/tensorflow/contrib/makefile/gen/lib/ios_ARM64/libtensorflow-core.a(node_def.pb.o)
duplicate symbol __ZTIN10tensorflow7NodeDefE in:
~/Documents/Projects/tensorflow/tensorflow/contrib/makefile/gen/lib/ios_ARM64/libtensorflow-core.a(node_def.pb.o)
duplicate symbol __ZN10tensorflow7NodeDef8CopyFromERKN6google8protobuf7MessageE in:
~/Documents/Projects/tensorflow/tensorflow/contrib/makefile/gen/lib/ios_ARM64/libtensorflow-core.a(node_def.pb.o)
duplicate symbol __ZN10tensorflow7NodeDef9MergeFromERKN6google8protobuf7MessageE in:
~/Documents/Projects/tensorflow/tensorflow/contrib/makefile/gen/lib/ios_ARM64/libtensorflow-core.a(node_def.pb.o)
duplicate symbol __ZNK10tensorflow7NodeDef3NewEPN6google8protobuf5ArenaE in:
~/Documents/Projects/tensorflow/tensorflow/contrib/makefile/gen/lib/ios_ARM64/libtensorflow-core.a(node_def.pb.o)
duplicate symbol __ZN10tensorflow7NodeDefC2EPN6google8protobuf5ArenaE in:
~/Documents/Projects/tensorflow/tensorflow/contrib/makefile/gen/lib/ios_ARM64/libtensorflow-core.a(node_def.pb.o)
duplicate symbol __ZN10tensorflow7NodeDefC1EPN6google8protobuf5ArenaE in:
~/Documents/Projects/tensorflow/tensorflow/contrib/makefile/gen/lib/ios_ARM64/libtensorflow-core.a(node_def.pb.o)
duplicate symbol __ZN10tensorflow81static_descriptor_initializer_tensorflow_2fcore_2fframework_2fnode_5fdef_2eproto_E in:
~/Documents/Projects/tensorflow/tensorflow/contrib/makefile/gen/lib/ios_ARM64/libtensorflow-core.a(node_def.pb.o)
duplicate symbol __ZN10tensorflow7NodeDef17default_instance_E in:
~/Documents/Projects/tensorflow/tensorflow/contrib/makefile/gen/lib/ios_ARM64/libtensorflow-core.a(node_def.pb.o)
ld: 44 duplicate symbols for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [~/Documents/Projects/tensorflow/tensorflow/contrib/makefile/gen/bin/ios_ARM64/benchmark] Error 1
請格式化您的問題 –
@bub謝謝,重新格式化 –