Skip to main content

General purpose model trainer for PyTorch that is more flexible than it should be, by 🐸Coqui.

Project description

👟 Trainer

An opinionated general purpose model trainer on PyTorch with a simple code base.

Installation

From Github:

git clone https://github.com/coqui-ai/Trainer
cd Trainer
make install

From PyPI:

pip install trainer

Prefer installing from Github as it is more stable.

Implementing a model

Subclass and overload the functions in the TrainerModel()

Training a model

See the test script here training a basic MNIST model.

Training with DDP

$ python -m trainer.distribute --script path/to/your/train.py --gpus "0,1"

We don't use .spawn() to initiate multi-gpu training since it causes certain limitations.

  • Everything must the pickable.
  • .spawn() trains the model in subprocesses and the model in the main process is not updated.
  • DataLoader with N processes gets really slow when the N is large.

Supported Experiment Loggers

To add a new logger, you must subclass BaseDashboardLogger and overload its functions.

Project details


Download files

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

Source Distribution

trainer-0.0.11.tar.gz (35.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

trainer-0.0.11-py3-none-any.whl (40.5 kB view details)

Uploaded Python 3

File details

Details for the file trainer-0.0.11.tar.gz.

File metadata

  • Download URL: trainer-0.0.11.tar.gz
  • Upload date:
  • Size: 35.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.8.12

File hashes

Hashes for trainer-0.0.11.tar.gz
Algorithm Hash digest
SHA256 20c8b3ee0c19b01fd685922d2383b44d3aa76de0028a2bd8f8b466ed7e1da778
MD5 1c9d0ff50ba96619b2fa0997f5fdf4ce
BLAKE2b-256 fc5e6d711f74b47d919cb7c7547daa31f317a2b7e4475a767e9889e0231ca962

See more details on using hashes here.

File details

Details for the file trainer-0.0.11-py3-none-any.whl.

File metadata

  • Download URL: trainer-0.0.11-py3-none-any.whl
  • Upload date:
  • Size: 40.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.8.12

File hashes

Hashes for trainer-0.0.11-py3-none-any.whl
Algorithm Hash digest
SHA256 487c0bbbdcb8a5db5b5f72286f2dc61410a48eb71cebf4d2c9acdd9e83a7ef41
MD5 2afbd89115525ca5f990e3e08932a4be
BLAKE2b-256 1ce13447d76dc5e8b43f4c555d6e030f271fa929e432345b6a374ad60adb038d

See more details on using hashes here.

Supported by

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