Skip to content
TRAINS - Auto-Magical Experiment Manager & Version Control for AI
Branch: master
Clone or download
allegroai Simplify examples
Latest commit f663add Aug 19, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
docs Add initial Azure storage support Aug 19, 2019
examples Simplify examples Aug 19, 2019
trains version bump Aug 19, 2019
.gitignore Ignore examples output Jun 11, 2019
LICENSE Initial commit Jun 10, 2019 Documentation Aug 9, 2019
_config.yml Set theme jekyll-theme-hacker Jun 10, 2019
requirements.txt Remove boto3 and google-cloud-storage from requirements. Only if you … Aug 19, 2019
setup.cfg Documentation Jun 11, 2019 Documentation Jun 13, 2019


Auto-Magical Experiment Manager & Version Control for AI

"Because it’s a jungle out there"

GitHub license PyPI pyversions PyPI version PyPI status

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.

(Experience TRAINS live at Alt Text

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
  • Tensorboard/TensorboardX scalars, metrics, histograms, images (with audio coming soon)
  • Matplotlib & Seaborn
  • Supported frameworks: Tensorflow, PyTorch, Keras, XGBoost and Scikit-Learn (MxNet is coming soon)
  • Seamless integration (including version control) with Jupyter Notebook and PyCharm remote debugging

Detailed overview of TRAINS offering and system design can be found here.


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 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 have a demo server up and running at You can try out TRAINS and test your code with it. Note that it resets every 24 hours and all of the 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)

Community & Support

For more examples and use cases, check examples.

If you have any questions, look to the TRAINS FAQ, 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!

You can’t perform that action at this time.