Is it possible to convert your own custom BERT model trained on Pytorch? I can see an example for a pre-trained BERT-NER model but I want to convert a custom model based on bert-base-cased. I have converted my model to ONNX and have tried to run the mo.py but get this error:
[ ERROR ] Exception occurred during running replacer "REPLACEMENT_ID" (<class 'extensions.front.input_cut.InputCut'>): --input parameter was provided. Other inputs are needed for output computation. Provide more inputs or choose another place to cut the net.
Is what I am try to do even possible?
Thanks for your information.
I’ve encountered the same error as you did when I convert your ONNX model.
Therefore, please share your source model with us.
Also, please share the command of conversion to ONNX with us.
Thanks and regards,
I have successfully converted your custom PyTorch bert-base-cased model into an ONNX file, then into Intermediate Representation using OpenVINO™ 2021.4 on Windows 10. You may refer to the steps below:
1. Download the BERT_BASE model and copy the model_config.json file to your custom model directory.
2. Steps to convert PyTorch bert-base-cased model to ONNX model is available on the following page:
3. Steps to convert ONNX bert-base-cased model to IR is available on the following page:
For more information, please refer to the steps to convert PyTorch BERT-NER to the Intermediate Representation on the following page:
On another note, you may download the ONNX and IR files from this link.
BERT Named Entity Recognition Python Demo is a demo application that reads command line parameters and loads a network to the Inference Engine. It also fetches data from the user-provided URL to populate the "context" text. The text is then used to search named entities.
Supported models for this demo application is available on the following page:
I have looked through all the BERT demos you have provided and with some work I could probably modify them to work with my BERT sentiment classification model. But I think it would be good if you had a sentiment classification demo on your site as this type of BERT model is very common. It would be good if you could add such a demo to your roadmap.
This thread will no longer be monitored since we have provided suggestions.
If you need any additional information from Intel, please submit a new question.