pytorch/ios-demo-app

Fatal error: Failed to load model!

Closed this issue ยท 3 comments

I was deploying the official code in ios-demo-app/ObjectDetection on my iPhone(ios 14.0).

I have copied the result of the export.py (yolov5s.torchscript.pt) to the ios-demo-app/ObjectDetection/ObjectDetection folder. Then It was built successfully but when I tried to run the model, this error occured to me.

Same error happened when I tried the ios-demo-app/PytorchDemo code. I am wondering if 'Bundle.main.path' can correctly open this .pt file.

WeChat388030beb7d97de3e6f42d09cb5fd50e

Hey @monica3-3 please post your solution here as a reference? Thanks!

Hey @monica3-3 please post your solution here as a reference? Thanks!

@JorgeCeja pytorch/android-demo-app#132

In Podfile:
Change from
pod 'LibTorch', '1.7.0'
to
pod 'LibTorch', '1.8.0'

pod install

Worked for me

Edit Podfile:

# Uncomment the next line to define a global platform for your project
platform :ios, '12.0'

target 'ObjectDetection' do
  # Comment the next line if you don't want to use dynamic frameworks
  use_frameworks!

  # Pods for ObjectDetection
  pod 'LibTorch-Lite', '~>1.12.0'
end

Worked for me