Skip to content
This repository was archived by the owner on Sep 25, 2026. It is now read-only.
This repository was archived by the owner on Sep 25, 2026. It is now read-only.

Set versions of packages in training and scoring #128

Closed

Description

During training, the version of packages such as scikit-learn is not defined, so the latest version is picked up:

'scikit-learn', 'tensorflow', 'keras'],

During scoring, the version of most (but not all) packages is set:

- scikit-learn==0.21.3

This led to binary incompatibility of the saved model when a new version of scikit-learn was released: #127, #126

For IaC best practices, we should use fixed versions for all packages in all environments.

Ideally we should also have a mechanism to define in a single place the names and versions of packages needed in training and scoring, to avoid redundancy and the risk of divergence.

Activity

  1. dtzar commented on Jan 28, 2020

    @dtzar
    Contributor

    Let's not forget about the requirements.txt file in the environment setup. It would be great to be consistent in using top-level packages with versions. Scoring dependencies should mirror a smaller version of the training requirements dependencies.

  2. algattik commented on Jan 29, 2020

    @algattik
    ContributorAuthor

    I'm preparing a PR, where we have 3 conda YAML environment definition (for training, scoring, and CI), and using conda-merge to merge all 3 for the build container. conda-merge should also fail in case of incompatible versions.

    The impact of this would be to require the use of conda for dev, while today the repo happens to work also without conda. In practice using conda is an explicit requirement of the AML SDK and very useful for installing more advanced ML frameworks.

  3. dtzar commented on Jan 29, 2020

    @dtzar
    Contributor

    Sounds good Alexandre Gattiker (@algattik)! IMO we should weave this standardization in with https://docs.microsoft.com/en-us/azure/machine-learning/how-to-use-environments in the code.

    I'd also prefer to use miniconda if possible so the overhead is less.

  4. sudivate commented on Jan 30, 2020

    @sudivate
    Contributor

    Alexandre Gattiker (@algattik) please take look at my branch. This is what I'm trying.

    1. One condadependencies.yaml to create an aml environment that is registered with workspace and used for both training and scoring
    2. keeping requirement.txt only with dependencies needed for CI container
    3. manage_environment.py to create a new or pull existing environment
  5. dtzar commented on Jan 30, 2020

    @dtzar
    Contributor

    Looking at both of your code branches, here are some ideas:

    1. Avoid using conda-merge and stick to three conda deps files:
      • scoring - smallest number of deps to just run inference
      • training - slightly more deps to enable train on remote compute
      • ci - training plus what is needed for container & local development (i.e. tox, flake8, pytest, etc)
        IMO conda-merge adds more unnecessary tools and complexity
    2. Use Sushant's environment code foundation to register and use the scoring/training AzML environments via those deps
    3. scoring/training/ci deps should all have pinned versions which match each other
  6. algattik commented on Jan 30, 2020

    @algattik
    ContributorAuthor

    Looking at both of your code branches, here are some ideas:

    1. Avoid using conda-merge and stick to three conda deps files:

      • scoring - smallest number of deps to just run inference
      • training - slightly more deps to enable train on remote compute
      • ci - training plus what is needed for container & local development (i.e. tox, flake8, pytest, etc)
        IMO conda-merge adds more unnecessary tools and complexity
    2. Use Sushant's environment code foundation to register and use the scoring/training AzML environments via those deps

    3. scoring/training/ci deps should all have pinned versions which match each other

    1. That's feasible. conda-merge surely has downsides, but I find it interesting that it protects from what I see time and time again - developers changing the version in training and forgetting to keep scoring in sync.
      Perhaps we should change the layout to have the 3 conda files in a single dir, to help with that?
    2. Yes, working with Sushant on that.
    3. Agree!
  7. dtzar commented on Jan 30, 2020

    @dtzar
    Contributor
    1. Yes, having them in a single dir would make it easier to compare.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions