Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoML+ONNX] Too many configurations #57

Open
faxu opened this issue Jan 13, 2020 · 1 comment
Open

[AutoML+ONNX] Too many configurations #57

faxu opened this issue Jan 13, 2020 · 1 comment

Comments

@faxu
Copy link

faxu commented Jan 13, 2020

When trying to get an ONNX model from AutoML, you need to set configurations in 3 places.

  1. AutoML config - enable_onnx_compatible_models=True,
  2. Get best run output - best_run, onnx_mdl = remote_run.get_output (return_onnx_model=True)
  3. Save ONNX model - from azureml.automl.runtime.onnx_convert import OnnxConverter
    onnx_fl_path = "./best_model.onnx"
    OnnxConverter.save_onnx_model(onnx_mdl, onnx_fl_path)

Ideally this should just be controlled in 1 place, perhaps when getting the model (step 2). Step #1 should go away once we have 100% ONNX support for AutoML models, so for short term it's ok.
It's unclear why step 3 is needed with a separate ONNXConverter. Can this step be merged with #2? The mechanism/convention to save an ONNX model should be the same as saving a non-ONNX model.

(reference notebook: https://github.com/Azure/MachineLearningNotebooks/blob/master/how-to-use-azureml/automated-machine-learning/classification-bank-marketing-all-features/auto-ml-classification-bank-marketing-all-features.ipynb)

@CESARDELATORRE
Copy link
Collaborator

CESARDELATORRE commented Jan 14, 2020

In reality Step #2 and #3 are both optional:

The ONNX model file is ready in the /outputs folder (if ONNX was set in the AutoML confing) so it can also be downloaded with:

best_run.download_file('outputs/model.onnx')

As you can also download other files created by AutoML:

best_run.download_file('outputs/model.pkl')
best_run.download_file('outputs/conda_env_v_1_0_0.yml')
best_run.download_file('outputs/env_dependencies.json')
best_run.download_file('outputs/scoring_file_v_1_0_0.py')
best_run.download_file('pipeline_graph.json')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants