Skip to content

Commit

Permalink
Moved examples/contrib into examples
Browse files Browse the repository at this point in the history
  • Loading branch information
vfdev-5 committed Aug 19, 2023
1 parent cf3fdd1 commit 5313170
Show file tree
Hide file tree
Showing 37 changed files with 97 additions and 150 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/gpu-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -153,21 +153,21 @@ jobs:
# Check training on cifar10, run without backend
## initial run
CI=1 python examples/contrib/cifar10/main.py run --checkpoint_every=200 --stop_iteration=500
CI=1 python examples/cifar10/main.py run --checkpoint_every=200 --stop_iteration=500
## resume
CI=1 python examples/contrib/cifar10/main.py run --checkpoint_every=200 --num_epochs=7 --resume-from=/tmp/output-cifar10/resnet18_backend-None-1_stop-on-500/training_checkpoint_400.pt
CI=1 python examples/cifar10/main.py run --checkpoint_every=200 --num_epochs=7 --resume-from=/tmp/output-cifar10/resnet18_backend-None-1_stop-on-500/training_checkpoint_400.pt
# Check training on cifar10, run with NCCL backend using torchrun
## initial run
CI=1 torchrun --nproc_per_node=2 examples/contrib/cifar10/main.py run --backend=nccl --checkpoint_every=200 --stop_iteration=500
CI=1 torchrun --nproc_per_node=2 examples/cifar10/main.py run --backend=nccl --checkpoint_every=200 --stop_iteration=500
## resume
CI=1 torchrun --nproc_per_node=2 examples/contrib/cifar10/main.py run --backend=nccl --checkpoint_every=200 --num_epochs=7 --resume-from=/tmp/output-cifar10/resnet18_backend-nccl-2_stop-on-500/training_checkpoint_400.pt
CI=1 torchrun --nproc_per_node=2 examples/cifar10/main.py run --backend=nccl --checkpoint_every=200 --num_epochs=7 --resume-from=/tmp/output-cifar10/resnet18_backend-nccl-2_stop-on-500/training_checkpoint_400.pt

# Check training on cifar10, run with NCCL backend using spawn
## initial run
CI=1 python -u examples/contrib/cifar10/main.py run --backend=nccl --nproc_per_node=2 --checkpoint_every=200 --stop_iteration=500
CI=1 python -u examples/cifar10/main.py run --backend=nccl --nproc_per_node=2 --checkpoint_every=200 --stop_iteration=500
## resume
CI=1 python -u examples/contrib/cifar10/main.py run --backend=nccl --nproc_per_node=2 --checkpoint_every=200 --num_epochs=7 --resume-from=/tmp/output-cifar10/resnet18_backend-nccl-2_stop-on-500/training_checkpoint_400.pt
CI=1 python -u examples/cifar10/main.py run --backend=nccl --nproc_per_node=2 --checkpoint_every=200 --num_epochs=7 --resume-from=/tmp/output-cifar10/resnet18_backend-nccl-2_stop-on-500/training_checkpoint_400.pt

EOF
)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ Few pointers to get you started:
torch.cuda.amp vs nvidia/apex](https://github.com/pytorch/ignite/blob/master/examples/notebooks/Cifar100_bench_amp.ipynb)
- [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/pytorch/ignite/blob/master/examples/notebooks/MNIST_on_TPU.ipynb) [MNIST training on a single
TPU](https://github.com/pytorch/ignite/blob/master/examples/notebooks/MNIST_on_TPU.ipynb)
- [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1E9zJrptnLJ_PKhmaP5Vhb6DTVRvyrKHx) [CIFAR10 Training on multiple TPUs](https://github.com/pytorch/ignite/tree/master/examples/contrib/cifar10)
- [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1E9zJrptnLJ_PKhmaP5Vhb6DTVRvyrKHx) [CIFAR10 Training on multiple TPUs](https://github.com/pytorch/ignite/tree/master/examples/cifar10)
- [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/pytorch/ignite/blob/master/examples/notebooks/HandlersTimeProfiler_MNIST.ipynb) [Basic example of handlers
time profiling on MNIST training example](https://github.com/pytorch/ignite/blob/master/examples/notebooks/HandlersTimeProfiler_MNIST.ipynb)

Expand Down
2 changes: 1 addition & 1 deletion assets/tldr/teaser.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@
"source": [
"### Other links\n",
"\n",
"- Full featured CIFAR10 example: https://github.com/pytorch/ignite/tree/master/examples/contrib/cifar10\n"
"- Full featured CIFAR10 example: https://github.com/pytorch/ignite/tree/master/examples/cifar10\n"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion assets/tldr/teaser.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,4 +220,4 @@ def evaluate_model():


# Full featured CIFAR10 example:
# https://github.com/pytorch/ignite/tree/master/examples/contrib/cifar10
# https://github.com/pytorch/ignite/tree/master/examples/cifar10
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ def run(self):

linkcheck_ignore = [
"https://github.com/fossasia/visdom#visdom-arguments-python-only",
"https://github.com/pytorch/ignite/tree/master/examples/contrib/cifar10#check-resume-training",
"https://github.com/pytorch/ignite/tree/master/examples/cifar10#check-resume-training",
"https://github.com/pytorch/ignite/tree/master/examples/mnist#training-save--resume",
]

Expand Down
12 changes: 6 additions & 6 deletions docs/source/contrib/handlers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ Loggers

Below are a comprehensive list of examples of various loggers.

* See `tensorboardX mnist example <https://github.com/pytorch/ignite/blob/master/examples/contrib/mnist/mnist_with_tensorboard_logger.py>`_
* See `tensorboardX mnist example <https://github.com/pytorch/ignite/blob/master/examples/mnist/mnist_with_tensorboard_logger.py>`_
and `CycleGAN and EfficientNet notebooks <https://github.com/pytorch/ignite/tree/master/examples/notebooks>`_ for detailed usage.

* See `visdom mnist example <https://github.com/pytorch/ignite/blob/master/examples/contrib/mnist/mnist_with_visdom_logger.py>`_ for detailed usage.
* See `visdom mnist example <https://github.com/pytorch/ignite/blob/master/examples/mnist/mnist_with_visdom_logger.py>`_ for detailed usage.

* See `neptune mnist example <https://github.com/pytorch/ignite/blob/master/examples/contrib/mnist/mnist_with_neptune_logger.py>`_ for detailed usage.
* See `neptune mnist example <https://github.com/pytorch/ignite/blob/master/examples/mnist/mnist_with_neptune_logger.py>`_ for detailed usage.

* See `tqdm mnist example <https://github.com/pytorch/ignite/blob/master/examples/contrib/mnist/mnist_with_tqdm_logger.py>`_ for detailed usage.
* See `tqdm mnist example <https://github.com/pytorch/ignite/blob/master/examples/mnist/mnist_with_tqdm_logger.py>`_ for detailed usage.

* See `wandb mnist example <https://github.com/pytorch/ignite/blob/master/examples/contrib/mnist/mnist_with_wandb_logger.py>`_ for detailed usage.
* See `wandb mnist example <https://github.com/pytorch/ignite/blob/master/examples/mnist/mnist_with_wandb_logger.py>`_ for detailed usage.

* See `clearml mnist example <https://github.com/pytorch/ignite/blob/master/examples/contrib/mnist/mnist_with_clearml_logger.py>`_ for detailed usage.
* See `clearml mnist example <https://github.com/pytorch/ignite/blob/master/examples/mnist/mnist_with_clearml_logger.py>`_ for detailed usage.
2 changes: 1 addition & 1 deletion docs/source/distributed.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ in the code. For more details, please, see :class:`~ignite.distributed.launcher.
:meth:`~ignite.distributed.auto.auto_dataloader`.

Complete example of CIFAR10 training can be found
`here <https://github.com/pytorch/ignite/tree/master/examples/contrib/cifar10>`_.
`here <https://github.com/pytorch/ignite/tree/master/examples/cifar10>`_.


.. _torch.distributed.launch: https://pytorch.org/docs/stable/distributed.html#launch-utility
Expand Down
4 changes: 2 additions & 2 deletions docs/source/engine.rst
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ from iteration.
Complete examples that resumes the training from a checkpoint can be found here:

- `save/resume MNIST <https://github.com/pytorch/ignite/tree/master/examples/mnist#training-save--resume>`_
- `save/resume Distributed CIFAR10 <https://github.com/pytorch/ignite/tree/master/examples/contrib/cifar10#check-resume-training>`_
- `save/resume Distributed CIFAR10 <https://github.com/pytorch/ignite/tree/master/examples/cifar10#check-resume-training>`_

Deterministic training
----------------------
Expand Down Expand Up @@ -216,7 +216,7 @@ Complete examples that simulates a crash on a defined iteration and resumes the
here:

- `save/resume MNIST <https://github.com/pytorch/ignite/tree/master/examples/mnist#training-save--resume>`_
- `save/resume Distributed CIFAR10 <https://github.com/pytorch/ignite/tree/master/examples/contrib/cifar10#check-resume-training>`_
- `save/resume Distributed CIFAR10 <https://github.com/pytorch/ignite/tree/master/examples/cifar10#check-resume-training>`_


.. Note ::
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
67 changes: 0 additions & 67 deletions examples/contrib/mnist/README.md

This file was deleted.

34 changes: 24 additions & 10 deletions examples/mnist/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

ported from [pytorch-examples](https://github.com/pytorch/examples/tree/master/mnist)

#### Requirements:
#### Minimal requirements:

- [torchvision](https://github.com/pytorch/vision/): `pip install torchvision`
- [tqdm](https://github.com/tqdm/tqdm/): `pip install tqdm`
Expand All @@ -11,22 +11,25 @@ ported from [pytorch-examples](https://github.com/pytorch/examples/tree/master/m

Run the example:

```
```bash
python mnist.py
```

Same example with logging using TQDM progress bar


```bash
python mnist_with_tqdm_logger.py
```

### Logging with Tensorboard

MNIST example with training and validation monitoring using Tensorboard. Notice
that if PyTorch version is less than 1.2, the module TensorboardX is required.
MNIST example with training and validation monitoring using Tensorboard

#### Requirements:
#### Additional requirements:

- [torchvision](https://github.com/pytorch/vision/): `pip install torchvision`
- [TensorboardX](https://github.com/lanpa/tensorboard-pytorch) (if and only if `PyTorch <= 1.2`): `pip install tensorboardX`
- Tensorboard: `pip install tensorboard`

#### Usage:

Run the example:

Expand All @@ -44,9 +47,8 @@ tensorboard --logdir=/tmp/tensorboard_logs/

MNIST example with training and validation monitoring using Visdom

#### Requirements:
#### Additional requirements:

- [torchvision](https://github.com/pytorch/vision/): `pip install torchvision`
- [Visdom](https://github.com/facebookresearch/visdom): `pip install visdom`

#### Usage:
Expand All @@ -63,6 +65,18 @@ Run the example:
python mnist_with_visdom.py
```

### Logging with ClearML

#### Additional requirements:

- [ClearML python client](https://clear.ml/docs/latest/docs/): `pip install clearml`

#### Usage:

```bash
python mnist_with_clearml_logger.py
```

### Training save & resume

Example shows how to save a checkpoint of the trainer, model, optimizer, lr scheduler.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 5313170

Please sign in to comment.