PeterL1n / RobustVideoMatting

Robust Video Matting in PyTorch, TensorFlow, TensorFlow.js, ONNX, CoreML!
https://peterl1n.github.io/RobustVideoMatting/
GNU General Public License v3.0
8.32k stars 1.11k forks source link

export coreML not working #253

Open DanielZanchi opened 8 months ago

DanielZanchi commented 8 months ago

I am trying to obtain a coreML model with an aspect ration of 1:1. so I am using this command: python3 export_coreml.py \ --model-variant mobilenetv3 \ --checkpoint rvm_mobilenetv3.pth \ --resolution 1080 1080 \ --downsample-ratio 0.25 \ --quantize-nbits 16 \ --output video_matting.mlmodel

But i get this error: Traceback (most recent call last): File "/Users/danielzanchi/Downloads/RobustVideoMatting-coreml/export_coreml.py", line 192, in <module> Exporter() File "/Users/danielzanchi/Downloads/RobustVideoMatting-coreml/export_coreml.py", line 28, in __init__ self.register_custom_ops() File "/Users/danielzanchi/Downloads/RobustVideoMatting-coreml/export_coreml.py", line 57, in register_custom_ops def hardswish_(context, node): File "/usr/local/lib/python3.9/site-packages/coremltools/converters/mil/frontend/torch/torch_op_registry.py", line 36, in func_wrapper raise Exception( Exception: Attempting to register "hardswish_" op. Do not register inplace ops. (inplace torch ops end in a "_"). Instead register the normal op version: "hardswish". The inplace version will be supported automatically.

suggestions?