2020-06-17 22:07:52 +00:00
# Allegro Trains
## Auto-Magical Experiment Manager, Version Control and ML-Ops for AI
2019-06-10 17:00:28 +00:00
2020-06-03 01:07:16 +00:00
## :confetti_ball: Now with Full ML/DL DevOps - See [TRAINS AGENT](https://github.com/allegroai/trains-agent) and [Services](https://github.com/allegroai/trains-server#trains-agent-services--)
2020-02-06 13:52:05 +00:00
## :station: [Documentation is here!](https://allegro.ai/docs) `wubba lubba dub dub` and a [Slack Channel](https://join.slack.com/t/allegroai-trains/shared_invite/enQtOTQyMTI1MzQxMzE4LTY5NTUxOTY1NmQ1MzQ5MjRhMGRhZmM4ODE5NTNjMTg2NTBlZGQzZGVkMWU3ZDg1MGE1MjQxNDEzMWU2NmVjZmY) :train2:
2020-06-23 22:46:07 +00:00
## Features: [AWS autoscaler](https://github.com/allegroai/trains-agent/blob/master/examples/dynamic_cloud_cluster.ipynb) :robot: [Hyper-Parameter Optimization](https://github.com/allegroai/trains/blob/master/examples/optimization/hyper-parameter-optimization) and :electric_plug: [Pipelines](https://github.com/allegroai/trains/blob/master/examples/automation/task_piping_example.py)
2019-10-29 20:20:24 +00:00
2019-07-08 20:29:09 +00:00
"Because it’ s a jungle out there"
2019-06-10 17:00:28 +00:00
2019-06-11 15:11:28 +00:00
[![GitHub license ](https://img.shields.io/github/license/allegroai/trains.svg )](https://img.shields.io/github/license/allegroai/trains.svg)
2019-06-11 11:36:36 +00:00
[![PyPI pyversions ](https://img.shields.io/pypi/pyversions/trains.svg )](https://img.shields.io/pypi/pyversions/trains.svg)
[![PyPI version shields.io ](https://img.shields.io/pypi/v/trains.svg )](https://img.shields.io/pypi/v/trains.svg)
[![PyPI status ](https://img.shields.io/pypi/status/trains.svg )](https://pypi.python.org/pypi/trains/)
2020-06-07 01:09:57 +00:00
### :point_right: Help improve Trains by filling our 2-min [user survey](https://allegro.ai/lp/trains-user-survey/)
2020-05-03 06:43:26 +00:00
2020-06-17 22:07:52 +00:00
Trains is our solution to a problem we share with countless other researchers and developers in the machine
2019-07-08 20:29:09 +00:00
learning/deep learning universe: Training production-grade deep learning models is a glorious but messy process.
2020-06-17 22:07:52 +00:00
Trains tracks and controls the process by associating code version control, research projects,
2019-07-08 20:29:09 +00:00
performance metrics, and model provenance.
2019-06-10 17:00:28 +00:00
2020-06-17 22:07:52 +00:00
We designed Trains specifically to require effortless integration so that teams can preserve their existing methods
2019-06-13 22:08:08 +00:00
and practices. Use it on a daily basis to boost collaboration and visibility, or use it to automatically collect
2019-06-13 22:07:02 +00:00
your experimentation logs, outputs, and data to one centralized server.
2019-06-10 17:00:28 +00:00
2020-01-26 14:08:35 +00:00
**We have a demo server up and running at [https://demoapp.trains.allegro.ai ](https://demoapp.trains.allegro.ai ).**
2020-06-07 01:09:57 +00:00
### :steam_locomotive: [Getting Started Tutorial](https://allegro.ai/blog/setting-up-allegro-ai-platform/) :rocket:
2020-06-17 22:07:52 +00:00
**You can try out Trains and [test your code ](#integrate-trains ), with no additional setup.**
2019-10-28 20:01:01 +00:00
< a href = "https://demoapp.trains.allegro.ai" > < img src = "https://github.com/allegroai/trains/blob/master/docs/webapp_screenshots.gif?raw=true" width = "100%" > < / a >
2019-06-10 17:00:28 +00:00
2020-06-17 22:07:52 +00:00
## Trains Automatically Logs Everything
2019-07-15 08:30:46 +00:00
**With only two lines of code, this is what you are getting:**
2019-08-03 00:04:48 +00:00
* Git repository, branch, commit id, entry point and local git diff
2019-08-03 00:24:00 +00:00
* Python environment (including specific packages & versions)
2019-09-07 20:28:32 +00:00
* stdout and stderr
2019-08-05 10:24:42 +00:00
* Resource Monitoring (CPU/GPU utilization, temperature, IO, network, etc.)
2019-08-03 00:24:00 +00:00
* Hyper-parameters
2019-07-15 08:30:46 +00:00
* ArgParser for command line parameters with currently used values
2019-08-03 00:04:48 +00:00
* Explicit parameters dictionary
2019-09-07 20:28:32 +00:00
* Tensorflow Defines (absl-py)
2019-07-15 08:30:46 +00:00
* Initial model weights file
2019-09-24 22:12:22 +00:00
* Model snapshots (With optional automatic upload to central storage: Shared folder, S3, GS, Azure, Http)
* Artifacts log & store (Shared folder, S3, GS, Azure, Http)
2020-06-07 01:09:57 +00:00
* Tensorboard/TensorboardX scalars, metrics, histograms, **images, audio and video**
2020-06-15 20:20:04 +00:00
* [Matplotlib & Seaborn ](https://github.com/allegroai/trains/tree/master/examples/frameworks/matplotlib )
* Supported frameworks: [PyTorch ](https://github.com/allegroai/trains/tree/master/examples/frameworks/pytorch ), [Tensorflow ](https://github.com/allegroai/trains/tree/master/examples/frameworks/tensorflow ), [Keras ](https://github.com/allegroai/trains/tree/master/examples/frameworks/keras ), [AutoKeras ](https://github.com/allegroai/trains/tree/master/examples/frameworks/autokeras ), [XGBoost ](https://github.com/allegroai/trains/tree/master/examples/frameworks/xgboost ) and [Scikit-Learn ](https://github.com/allegroai/trains/tree/master/examples/frameworks/scikit-learn ) (MxNet is coming soon)
2019-08-03 00:20:40 +00:00
* Seamless integration (including version control) with **Jupyter Notebook**
2019-08-03 00:24:00 +00:00
and [*PyCharm* remote debugging ](https://github.com/allegroai/trains-pycharm-plugin )
2020-06-17 22:07:52 +00:00
**Additionally, log data explicitly using [Trains Explicit Logging ](https://github.com/allegroai/trains/blob/master/docs/logger.md ).**
2019-07-08 20:29:09 +00:00
2020-06-17 22:07:52 +00:00
## Using Trains <a name="using-trains"></a>
2019-06-10 17:00:28 +00:00
2020-06-17 22:07:52 +00:00
Trains is a two part solution:
2019-06-11 12:10:16 +00:00
2020-06-17 22:07:52 +00:00
1. Trains [python package ](https://pypi.org/project/trains/ ) auto-magically connects with your code
2019-08-03 00:24:00 +00:00
2020-06-17 22:07:52 +00:00
**Trains requires only two lines of code for full integration.**
2019-07-08 20:29:09 +00:00
2020-06-17 22:07:52 +00:00
To connect your code with Trains:
2019-07-08 20:29:09 +00:00
2020-06-17 22:07:52 +00:00
- Install Trains < a name = "integrate-trains" ></ a >
2019-06-10 17:00:28 +00:00
2019-07-15 08:30:46 +00:00
pip install trains
2019-10-29 23:48:14 +00:00
< details >
< summary > Add optional cloud storage support (S3/GoogleStorage/Azure):< / summary >
```bash
pip install trains[s3]
pip install trains[gs]
pip install trains[azure]
```
< / details >
2020-01-26 14:09:42 +00:00
- Add the following lines to your code
2019-06-10 17:00:28 +00:00
2019-07-15 08:30:46 +00:00
from trains import Task
task = Task.init(project_name="my project", task_name="my task")
2019-06-10 17:00:28 +00:00
2019-07-15 08:30:46 +00:00
* 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
2019-06-10 17:00:28 +00:00
2020-06-17 22:07:52 +00:00
- Run your code. When Trains connects to the server, a link is printed. For example
2019-07-08 20:29:09 +00:00
2020-06-17 22:07:52 +00:00
Trains Results page:
2019-10-28 20:01:01 +00:00
https://demoapp.trains.allegro.ai/projects/76e5e2d45e914f52880621fe64601e85/experiments/241f06ae0f5c4b27b8ce8b64890ce152/output/log
2019-06-11 12:10:16 +00:00
2019-07-15 08:30:46 +00:00
- Open the link and view your experiment parameters, model and tensorboard metrics
2019-08-03 00:24:00 +00:00
2019-08-03 00:09:58 +00:00
**See examples [here](https://github.com/allegroai/trains/tree/master/examples)**
2019-06-10 17:00:28 +00:00
2020-06-17 22:07:52 +00:00
2. [Trains Server ](https://github.com/allegroai/trains-server ) for logging, querying, control and UI ([Web-App](https://github.com/allegroai/trains-web))
2020-01-26 14:08:35 +00:00
**We already have a demo server up and running for you at [https://demoapp.trains.allegro.ai](https://demoapp.trains.allegro.ai).**
2020-06-17 22:07:52 +00:00
**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.**
2020-01-26 14:08:35 +00:00
*Note that the demo server resets every 24 hours and all of the logged data is deleted.*
2020-06-17 22:07:52 +00:00
When you are ready to use your own Trains server, go ahead and [install *trains-server* ](https://github.com/allegroai/trains-server ).
2019-07-15 08:30:46 +00:00
2019-08-09 00:49:14 +00:00
< img src = "https://github.com/allegroai/trains/blob/master/docs/system_diagram.png?raw=true" width = "50%" >
2019-07-15 08:30:46 +00:00
2020-06-17 22:07:52 +00:00
## Configuring Your Own Trains server <a name="configuration"></a>
2019-06-13 22:07:02 +00:00
2020-06-17 22:07:52 +00:00
1. Install and run *trains-server* (see [Installing the Trains Server ](https://github.com/allegroai/trains-server ))
2019-06-13 22:07:02 +00:00
2020-06-17 22:07:52 +00:00
2. Run the initial configuration wizard for your Trains installation and follow the instructions to setup Trains package
2019-07-08 20:29:09 +00:00
(http://**_trains-server-ip_**:__port__ and user credentials)
2019-06-10 17:00:28 +00:00
trains-init
2019-06-13 22:27:25 +00:00
After installing and configuring, you can access your configuration file at `~/trains.conf`
Sample configuration file available [here ](https://github.com/allegroai/trains/blob/master/docs/trains.conf ).
2019-06-10 17:00:28 +00:00
2019-07-08 20:29:09 +00:00
## Who We Are
2019-06-10 17:00:28 +00:00
2020-06-17 22:07:52 +00:00
Trains is supported by the same team behind *allegro.ai* ,
2019-06-13 22:07:02 +00:00
where we build deep learning pipelines and infrastructure for enterprise companies.
2020-06-17 22:07:52 +00:00
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.
2019-06-10 17:00:28 +00:00
2020-06-17 22:07:52 +00:00
## Why Are We Releasing Trains?
2019-06-10 17:00:28 +00:00
2020-06-17 22:07:52 +00:00
We believe Trains is ground-breaking. We wish to establish new standards of experiment management in
2019-06-13 22:07:02 +00:00
deep-learning and ML. Only the greater community can help us do that.
2019-06-10 17:00:28 +00:00
2020-06-17 22:07:52 +00:00
We promise to always be backwardly compatible. If you start working with Trains today,
2019-06-13 22:07:02 +00:00
even though this project is currently in the beta stage, your logs and data will always upgrade with you.
2019-06-10 17:00:28 +00:00
## License
Apache License, Version 2.0 (see the [LICENSE ](https://www.apache.org/licenses/LICENSE-2.0.html ) for more information)
2020-02-06 13:52:05 +00:00
## Documentation, Community & Support
2020-04-26 20:20:30 +00:00
More information in the [official documentation ](https://allegro.ai/docs ) and [on YouTube ](https://www.youtube.com/c/AllegroAI ).
2019-07-16 18:15:27 +00:00
2020-06-16 19:01:24 +00:00
For examples and use cases, check the [examples folder ](https://github.com/allegroai/trains/tree/master/examples ) and [corresponding documentation ](https://allegro.ai/docs/examples/examples_overview/ ).
2019-06-10 17:00:28 +00:00
2020-02-06 13:52:05 +00:00
If you have any questions: post on our [Slack Channel ](https://join.slack.com/t/allegroai-trains/shared_invite/enQtOTQyMTI1MzQxMzE4LTY5NTUxOTY1NmQ1MzQ5MjRhMGRhZmM4ODE5NTNjMTg2NTBlZGQzZGVkMWU3ZDg1MGE1MjQxNDEzMWU2NmVjZmY ), or tag your questions on [stackoverflow ](https://stackoverflow.com/questions/tagged/trains ) with '**trains**' tag.
2019-06-10 17:00:28 +00:00
2019-07-08 20:29:09 +00:00
For feature requests or bug reports, please use [GitHub issues ](https://github.com/allegroai/trains/issues ).
2019-07-09 09:12:50 +00:00
Additionally, you can always find us at *trains@allegro.ai*
2019-07-08 20:29:09 +00:00
## Contributing
2020-06-17 22:07:52 +00:00
See the Trains [Guidelines for Contributing ](https://github.com/allegroai/trains/blob/master/docs/contributing.md ).
2019-06-10 17:00:28 +00:00
2019-07-08 20:29:09 +00:00
_May the force (and the goddess of learning rates) be with you!_