pytorch/ios-demo-app

Expected Tensor but got Tuple debug_handle:-1

Opened this issue · 0 comments

Hi,
I was able to export the yolov5s model to tflite format as suggested using export.py. However, when I build on mac, I get the following errors:

[W TensorImpl.h:1156] Warning: Named tensors and all their associated APIs are an experimental feature and subject to change. Please do not use them for anything important until they are released as stable. (function operator())
2021-11-09 13:49:14.041245-0800 ObjectDetection[89695:352534] Expected Tensor but got Tuple

debug_handle:-1

Exception raised from reportToTensorTypeError at /Users/distiller/project/aten/src/ATen/core/ivalue.cpp:854 (most recent call first):
frame #0: _ZN3c105ErrorC1ENS_14SourceLocationENSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE + 75 (0x102b6b191 in ObjectDetection)
frame #1: _ZN3c106detail14torchCheckFailEPKcS2_jRKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEE + 106 (0x102b69d6d in ObjectDetection)
frame #2: _ZNK3c106IValue23reportToTensorTypeErrorEv + 78 (0x1025ffd60 in ObjectDetection)
frame #3: _ZN3c104impl34call_functor_with_args_from_stack_INS0_6detail31WrapFunctionIntoRuntimeFunctor_IPFN2at6TensorERKS5_S7_ES5_NS_4guts8typelist8typelistIJS7_S7_EEEEELb0EJLm0ELm1EEJS7_S7_EEENSt3__15decayINSA_21infer_function_traitsIT_E4type11return_typeEE4typeEPNS_14OperatorKernelENS_14DispatchKeySetEPNSF_6vectorINS_6IValueENSF_9allocatorISR_EEEENSF_16integer_sequenceImJXspT1_EEEEPNSC_IJDpT2_EEE + 65 (0x101d36422 in ObjectDetection)
frame #4: _ZN3c104impl31make_boxed_from_unboxed_functorINS0_6detail31WrapFunctionIntoRuntimeFunctor_IPFN2at6TensorERKS5_S7_ES5_NS_4guts8typelist8typelistIJS7_S7_EEEEELb0EE4callEPNS_14OperatorKernelERKNS_14OperatorHandleENS_14DispatchKeySetEPNSt3__16vectorINS_6IValueENSM_9allocatorISO_EEEE + 24 (0x101e397c8 in ObjectDetection)
frame #5: _ZNK3c1010Dispatcher9callBoxedERKNS_14OperatorHandleEPNSt3__16vectorINS_6IValueENS4_9allocatorIS6_EEEE + 119 (0x102a4e1d1 in ObjectDetection)
frame #6: _ZN5torch3jit6mobile16InterpreterState3runERNSt3__16vectorIN3c106IValueENS3_9allocatorIS6_EEEE + 5049 (0x102a5ae3f in ObjectDetection)
frame #7: _ZNK5torch3jit6mobile8Function3runERNSt3__16vectorIN3c106IValueENS3_9allocatorIS6_EEEE + 160 (0x102a4c5ec in ObjectDetection)
frame #8: _ZNK5torch3jit6mobile6Method3runERNSt3__16vectorIN3c106IValueENS3_9allocatorIS6_EEEE + 766 (0x102a5e5c8 in ObjectDetection)
frame #9: _ZNK5torch3jit6mobile6MethodclENSt3__16vectorIN3c106IValueENS3_9allocatorIS6_EEEE + 24 (0x102a5ecba in ObjectDetection)
frame #10: ZN5torch3jit6mobile6Module7forwardENSt3__16vectorIN3c106IValueENS3_9allocatorIS6_EEEE + 173 (0x102afe41d in ObjectDetection)
frame #11: -[InferenceModule + + (0x102afdbde in ObjectDetection)
frame #12: $s15ObjectDetection14ViewControllerC9runTappedyyypFyycfU
+ 1288 (0x102b17588 in ObjectDetection)
frame #13: $sIeg_IeyB_TR + 40 (0x102b08878 in ObjectDetection)
frame #14: _dispatch_call_block_and_release + 12 (0x10418ca28 in libdispatch.dylib)
frame #15: _dispatch_client_callout + 8 (0x10418dc0c in libdispatch.dylib)
frame #16: _dispatch_queue_override_invoke + 1054 (0x1041900a3 in libdispatch.dylib)
frame #17: _dispatch_root_queue_drain + 403 (0x10419fb44 in libdispatch.dylib)
frame #18: _dispatch_worker_thread2 + 196 (0x1041a05ec in libdispatch.dylib)
frame #19: _pthread_wqthread + 244 (0x7fff6bfeb417 in libsystem_pthread.dylib)
frame #20: start_wqthread + 15 (0x7fff6bfea42f in libsystem_pthread.dylib)

Please let me know how to resolve this issue. It is build for ioS version 14.0 by default.