Posts

Post not yet marked as solved
0 Replies
219 Views
I converted PyTorch model to CoreML model and want to use it in iOS device. I wrote the swift code, but the code works normally in the simulator but not in the real device. My CoreML model information and experimental environment are as follows. Model Type: Neural Network / Size: 60.8 MB / Document Type: Core ML Model / Availability: iOS 14.0+ / torch == 1.8.1 / coremltools == 5.2.0 / Experimental iOS version: 15.0 / Device: iPhone 12 Pro / And the error message is: 2022-04-19 10:36:24.404508+0900 test[2488:1369794] [espresso] [Espresso::handle_ex_plan] exception=Espresso exception: "Invalid blob shape": generic_elementwise_kernel: cannot broadcast: (1, 256, 128, 130) (1, 256, 128, 132)  status=-7 2022-04-19 10:36:24.404716+0900 test[2488:1369794] [coreml] Error in adding network -7. 2022-04-19 10:36:24.405000+0900 test[2488:1369794] [coreml] MLModelAsset: load failed with error Error Domain=com.apple.CoreML Code=0 "Error in declaring network." UserInfo={NSLocalizedDescription=Error in declaring network.} 2022-04-19 10:36:24.405029+0900 test[2488:1369794] [coreml] MLModelAsset: modelWithError: load failed with error Error Domain=com.apple.CoreML Code=0 "Error in declaring network." UserInfo={NSLocalizedDescription=Error in declaring network.} test/ContentView.swift:16: Fatal error: 'try!' expression unexpectedly raised an error: Error Domain=com.apple.CoreML Code=0 "Error in declaring network." UserInfo={NSLocalizedDescription=Error in declaring network.} 2022-04-19 10:36:24.405408+0900 test[2488:1369794] test/ContentView.swift:16: Fatal error: 'try!' expression unexpectedly raised an error: Error Domain=com.apple.CoreML Code=0 "Error in declaring network." UserInfo={NSLocalizedDescription=Error in declaring network.} (lldb)  I would appreciate it if you could let me know if you know the solution or if you know the related references. Thank you for reading it.
Posted Last updated
.