Open gustavofuhr opened 3 months ago
@cccclai @shoumikhin any ideas here?
Hey guys, any idea what I can triy here, or any debug it might give me some insights?
Hey thank you for trying out, can you try the partitioner flow? It will partially lower the model and the failing part will fall back to cpu
I changed the above code to:
edge_program = to_edge(aten_dialect)
lowered_module = edge_program.to_backend(
CoreMLPartitioner(
skip_ops_for_coreml_delegation=["aten.convolution.default"]
)
)
with open("models/yolo_executorch_coreml.pte", "wb") as file:
file.write(lowered_module.buffer())
got this error:
AttributeError: 'EdgeProgramManager' object has no attribute 'buffer'
to_backend
is returning something different: EdgeProgramManager
.
Maybe you guys can dumb it down for me, I'm still not understanding all the pipelines that executorch provides.
Try these lines?
edge_program = to_edge(aten_dialect)
edge_program = edge_program.to_backend(
CoreMLPartitioner(
skip_ops_for_coreml_delegation=["aten.convolution.default"]
)
)
et_program = edge_manager.to_executorch()
with open("models/yolo_executorch_coreml.pte", "wb") as file:
file.write(et_program.buffer)
🐛 Describe the bug
I'm trying to export the ultralytics YOLOv8 model using the CoreML backend, but I'm getting an error when saving the serialized lowered module.
Btw, I manage to save in the portable format.
Here's the code I'm using:
It's giving me the following error:
Versions
Collecting environment information... PyTorch version: 2.4.0 Is debug build: False CUDA used to build PyTorch: None ROCM used to build PyTorch: N/A
OS: macOS 14.5 (arm64) GCC version: Could not collect Clang version: 15.0.0 (clang-1500.3.9.4) CMake version: version 3.30.1 Libc version: N/A
Python version: 3.10.14 (main, Mar 19 2024, 21:46:16) [Clang 15.0.0 (clang-1500.3.9.4)] (64-bit runtime) Python platform: macOS-14.5-arm64-arm-64bit Is CUDA available: False CUDA runtime version: No CUDA CUDA_MODULE_LOADING set to: N/A GPU models and configuration: No CUDA Nvidia driver version: No CUDA cuDNN version: No CUDA HIP runtime version: N/A MIOpen runtime version: N/A Is XNNPACK available: True
CPU: Apple M3
Versions of relevant libraries: [pip3] executorch==0.3.0a0+ca8e0d2 [pip3] executorchcoreml==0.0.1 [pip3] numpy==1.26.4 [pip3] torch==2.4.0 [pip3] torchaudio==2.4.0 [pip3] torchsr==1.0.4 [pip3] torchvision==0.19.0 [conda] Could not collect