Skip to main content

TRAINS - Auto-Magical Experiment Manager & Version Control for AI

Project description

Allegro Trains

Auto-Magical Experiment Manager, Version Control and ML-Ops for AI

"Because it’s a jungle out there"

GitHub license PyPI pyversions PyPI version PyPI status Optuna Slack Channel

:point_right: Help improve Trains by filling our 2-min user survey

Trains is our solution to a problem we share with countless other researchers and developers in the machine learning/deep learning universe: Training production-grade deep learning models is a glorious but messy process. Trains tracks and controls the process by associating code version control, research projects, performance metrics, and model provenance.

We designed Trains specifically to require effortless integration so that teams can preserve their existing methods and practices. Use it on a daily basis to boost collaboration and visibility, or use it to automatically collect your experimentation logs, outputs, and data to one centralized server.

We have a demo server up and running at

:steam_locomotive: Getting Started Tutorial :rocket:

You can try out Trains and test your code, with no additional setup.

Trains Automatically Logs Everything

With only two lines of code, this is what you are getting:

  • Git repository, branch, commit id, entry point and local git diff
  • Python environment (including specific packages & versions)
  • stdout and stderr
  • Resource Monitoring (CPU/GPU utilization, temperature, IO, network, etc.)
  • Hyper-parameters
    • ArgParser for command line parameters with currently used values
    • Explicit parameters dictionary
    • Tensorflow Defines (absl-py)
  • Initial model weights file
  • Model snapshots (With optional automatic upload to central storage: Shared folder, S3, GS, Azure, Http)
  • Artifacts log & store (Shared folder, S3, GS, Azure, Http)
  • Tensorboard/TensorboardX scalars, metrics, histograms, images, audio and video
  • Matplotlib & Seaborn
  • Supported frameworks: PyTorch, Tensorflow, Keras, AutoKeras, XGBoost and Scikit-Learn (MxNet is coming soon)
  • Seamless integration (including version control) with Jupyter Notebook and PyCharm remote debugging

Additionally, log data explicitly using Trains Explicit Logging.

Using Trains

Trains is a two part solution:

  1. Trains python package auto-magically connects with your code

    Trains requires only two lines of code for full integration.

    To connect your code with Trains:

    • Install Trains

        pip install trains
      Add optional cloud storage support (S3/GoogleStorage/Azure):
       pip install trains[s3]
       pip install trains[gs]
       pip install trains[azure]
    • Add the following lines to your code

        from trains import Task
        task = Task.init(project_name="my project", task_name="my task")
      • If project_name is not provided, the repository name will be used instead
      • If task_name (experiment) is not provided, the current filename will be used instead
    • Run your code. When Trains connects to the server, a link is printed. For example

        Trains Results page:
    • Open the link and view your experiment parameters, model and tensorboard metrics

    See examples here

  2. Trains Server for logging, querying, control and UI (Web-App)

    We already have a demo server up and running for you at

    You can try out Trains without the need to install your own trains-server, just add the two lines of code, and it will automatically connect to the Trains demo-server.

    Note that the demo server resets every 24 hours and all of the logged data is deleted.

    When you are ready to use your own Trains server, go ahead and install trains-server.

Configuring Your Own Trains server

  1. Install and run trains-server (see Installing the Trains Server)

  2. Run the initial configuration wizard for your Trains installation and follow the instructions to setup Trains package (http://trains-server-ip:port and user credentials)


After installing and configuring, you can access your configuration file at ~/trains.conf

Sample configuration file available here.

Who We Are

Trains is supported by the same team behind, where we build deep learning pipelines and infrastructure for enterprise companies.

We built Trains to track and control the glorious but messy process of training production-grade deep learning models. We are committed to vigorously supporting and expanding the capabilities of Trains.

Why Are We Releasing Trains?

We believe Trains is ground-breaking. We wish to establish new standards of experiment management in deep-learning and ML. Only the greater community can help us do that.

We promise to always be backwardly compatible. If you start working with Trains today, even though this project is currently in the beta stage, your logs and data will always upgrade with you.


Apache License, Version 2.0 (see the LICENSE for more information)

Documentation, Community & Support

More information in the official documentation and on YouTube.

For examples and use cases, check the examples folder and corresponding documentation.

If you have any questions: post on our Slack Channel, or tag your questions on stackoverflow with 'trains' tag.

For feature requests or bug reports, please use GitHub issues.

Additionally, you can always find us at


See the Trains Guidelines for Contributing.

May the force (and the goddess of learning rates) be with you!

Project details

Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release. See tutorial on generating distribution archives.

Built Distribution

trains-0.16.4-py2.py3-none-any.whl (855.8 kB view hashes)

Uploaded py2 py3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page