Open heorhiikalaichev opened 1 year ago
Hi @heorhiikalaichev , thank you for your interest in DocShadow-ONNX-TensorRT.
I believe you were referred here from https://github.com/CXH-Research/DocShadow-SD7K/issues/6, but CoreML conversion does not need ONNX anymore. It is now recommended to convert directly from PyTorch via JIT tracing. Although I'm by no means an expert in CoreML, I think these are the issues you faced when naively tracing and converting the current DocShadow implementation to CoreML, in order:
PyTorch convert function for op 'var' not implemented.
(https://github.com/apple/coremltools/issues/1203)PyTorch convert function for op 'pythonop' not implemented.
(https://github.com/apple/coremltools/issues/1135)PyTorch convert function for op 'upsample_bicubic2d' not implemented.
I provided a simple export script which patches these issues and converts successfully: https://github.com/fabio-sim/DocShadow-ONNX-TensorRT/blob/ec926bf36b4ac0778f836a2d34e27021447df27c/export_coreml.py#L1-L59
Please do confirm whether the exported models run correctly on CoreML.
Thank you so much for your answer. I just made the same changes as you and was able to convert this model.
I will test results and inform you in case they are different from pytorch model results.
Hi!
Thank you for your job! Were you trying to convert this model to coreml? I faced some issues while handling this.