Skip to content

Using ExecuTorch on iOS error #11868

Open
Open
@MrJungle1

Description

@MrJungle1

🐛 Describe the bug

I followed this tutorial https://docs.pytorch.org/executorch/main/_static/img/swiftpm_xcode.mp4, using swiftpm-0.7.0.20250623, trying to run mobilenet v3 with coreml on iphone16pro, but got an error here

My code is as follows:
let path = Bundle.main.path(forResource: "mv3_coreml_all", ofType: "pte")!
print("model path:", path,
"; exists:", FileManager.default.fileExists(atPath: path))
let module = Module(filePath: path)
do {
// Note: methodNames() will load the program if not already loaded.
let names = try module.methodNames()
print("Available methods: (names)") // Output: e.g., {"forward"}
} catch {
print("Could not get method names: (error)")
}
try module.load("forward")
//Preload forward
print("module.load("forward") done")

The error is reported as follows:
model path: /private/var/containers/Bundle/Application/8FA974D9-D047-4465-A192-0D1A4943EAD1/ExecuTorchDemo.app/mv3_coreml_all.pte ; exists: true
Available methods: ["forward"]
ExecuTorch error: Error Domain=org.pytorch.executorch.error Code=32 "Resource not found" UserInfo={NSLocalizedDescription=Resource not found}

Versions

commit:bc605b84b66b6f3ddd1dc01c41ffa1bfb0d6f6b1

cc @shoumikhin @cbilgin

Metadata

Metadata

Assignees

Labels

module: iosIssues related to iOS code, build, and executiontriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions