sklearn-onnx icon indicating copy to clipboard operation
sklearn-onnx copied to clipboard

Sklearn converter for resnet50

Open AnuragShelar opened this issue 4 years ago • 1 comments

I have a resnet50 classification model in sklearn format(model saved in pkl ). I need to convert that model to onnx file format for further inferencing. Currently sklearn does not support Resnet 50 conversion. Kindly look into it . I am stuck at it for quite a long time.

Got the following error:

MissingShapeCalculator: Unable to find a shape calculator for type '<class 'torchvision.models.resnet.ResNet'>'. It usually means the pipeline being converted contains a transformer or a predictor with no corresponding converter implemented in sklearn-onnx. If the converted is implemented in another library, you need to register the converted so that it can be used by sklearn-onnx (function update_registered_converter). If the model is not yet covered by sklearn-onnx, you may raise an issue to https://github.com/onnx/sklearn-onnx/issues to get the converter implemented or even contribute to the project. If the model is a custom model, a new converter must be implemented. Examples can be found in the gallery.

AnuragShelar avatar Jan 11 '21 19:01 AnuragShelar

I assume this model is a pipeline using a model from torch. sklearn-onnx only converts pipeline including predictor or transformer from scikit-learn. The library gives the possibility to registrer new converters to convert pieces from other libraries (see Implement a new converter). Did you use skorch?

xadupre avatar Jan 12 '21 16:01 xadupre

Closing the issue, feel free to reopen it.

xadupre avatar Nov 24 '22 13:11 xadupre