Wednesday, December 7, 2022
HomeiOS Developmentios - Tensorflow frameworks for simulator and gadget

ios – Tensorflow frameworks for simulator and gadget


I’ve been attempting to generate a framework/xcframework that may run on each simulator and gadget. That is for tensorflow lite and I’ve been following these directions:

bazel construct --config=ios_fat -c decide --cxxopt=--std=c++17 
  //tensorflow/lite/ios:TensorFlowLiteC_framework

from

https://www.tensorflow.org/lite/information/build_ios#build_tensorflowlitec_dynamic_framework_recommended

If I take advantage of config=ios_fat, then I can not construct for simulator. If I take advantage of config=ios, I can construct for simulator however not gadget.

I both get

/path/Module/Framework/VideoProcessing/VideoProcessing.xcodeproj Constructing for iOS, however the linked framework 'TensorFlowLiteC.framework' was constructed for iOS Simulator.

or

constructing for iOS Simulator, however linking in object file constructed for iOS, file 'path/Module/thirdparty/installdir/tensorflow_device/frameworks/TensorFlowLiteC.framework/TensorFlowLiteC' for structure arm64

The second error doesn’t say it was not constructed for simulator, however the structure is inaccurate.

I’ve tried to mix these frameworks with

xcodebuild -create-xcframework -framework tensorflow_device/frameworks/TensorFlowLiteC.framework -framework tensorflow_simulator/framework/TensorFlowLiteC.framework

however this offers

error: binaries with a number of platforms usually are not supported '/pathModule/thirdparty/installdir/tensorflow_device/frameworks/TensorFlowLiteC.framework/TensorFlowLiteC

I’ve additionally tried to mix the libs with

lipo -create tensorflow_device/frameworks/TensorFlowLiteC.framework/TensorFlowLiteC tensorflow_simulator/framework/TensorFlowLiteC.framework/TensorFlowLiteC -output tensorflow/TensorFlowLiteC.framework/TensorFlowLiteC

Which provides the error

deadly error: /Purposes/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: tensorflow_device/frameworks/TensorFlowLiteC.framework/TensorFlowLiteC and tensorflow_simulator/framework/TensorFlowLiteC.framework/TensorFlowLiteC have the identical architectures (arm64) and cannot be in the identical fats output file

I can compile for iphone_simulator if I exclude arm64 as structure. However I assume I’ll want that for gadget, so can be good if there’s a resolution the place I can simply change goal.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments