Closed SaashaJoshi closed 2 months ago
The QML model, in the form of a NeuralNetworkClassifier
, does not conform to the mlflow.pyfunc.PythonModel
instance and cannot be saved through mlflow.pyfunc.save_model
class method.
One possible solution is to build a wrapper around the EstimatorQNN
primitive and the NeuralNetworkClassifier
so that it represents a PythonModel
that evaluates inputs and produces API-compatible outputs when called after training.
Refer Issue #58
Models perhaps need to be made Serializable
to support saving and loading. Refer here.
Also, add configuration for registering the trained model in a Model Registry. For example,
- name: Log with MLflow and Register Model
run: |
mlflow run . --experiment-name=${{ secrets.MLFLOW_EXPERIMENT_NAME }} --no-conda
mlflow models register -m "runs:/${{ github.sha }}/model" -n "your_model_name" -r "your_model_version" --experiment-name="${{ secrets.MLFLOW_EXPERIMENT_NAME }}" --no-conda
env:
MLFLOW_TRACKING_URI: ${{ secrets.MLFLOW_TRACKING_URI }}
MLFLOW_REGISTRY_URI: ${{ secrets.MLFLOW_REGISTRY_URI }}
MLFLOW_EXPERIMENT_NAME: ${{ secrets.MLFLOW_EXPERIMENT_NAME }}
This PR is transferred to another GitHub repo. Refer here.
Configure MLflow workflows for training, model and parameter logging, and model registry for deployment purposes.
Things to add:
PyFunc
wrapper forQiskitModel
Also, refer to this multi-step workflow example here.