Commit Graph

360 Commits (7d46c6923592861aa123802c8860dfafc15d0fe1)

Author SHA1 Message Date
Glenn Jocher f00071416f
Refactor collections and fstrings (#7821)
* Update torch_utils.py

* Additional code refactoring

* tuples to sets

* Cleanup
2022-05-15 16:38:26 +02:00
Glenn Jocher 4a295b1a89
Add `@threaded` decorator (#7813)
* Add `@threaded` decorator

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-05-14 16:12:08 +02:00
Glenn Jocher 9d8ed37df7
Rename `utils/datasets.py` > `utils/dataloaders.py` (#7799) 2022-05-13 14:34:16 +02:00
Glenn Jocher d95a728f55
Implement DDP `static_graph=True` (#6940)
* Implement DDP `static_graph=True`

Experimental implementation of new PyTorch 1.11.0 DDP feature.

* Add 1.11.0 check

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-05-13 12:32:47 +02:00
Glenn Jocher aa7a0e91b1
Update `on_train_end` callback (#7716) 2022-05-05 21:25:13 -07:00
Glenn Jocher b53917de8d
Remove `tqdm.auto` (#7599) 2022-04-26 15:00:01 -07:00
Glenn Jocher 7043872f25
PyTorch Hub `_verbose=False` fix2 (#7550)
* PyTorch Hub `_verbose=False` fix2

* Update downloads.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update hubconf.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-04-23 11:26:25 -07:00
Ayush Chaurasia 4cac1cfc8f
Add `--noplots` flag to suppress figures and images logging (#7534)
* support nomedia

* support nomedia for validation

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update train.py

* Revert no plot evolve

evolve plots do not contain any images

* Revert plot_results

contains no media

* Update wandb_utils.py

* sync-bn cleanup

* Cleanup

* Rename nomedia -> noplots

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2022-04-22 15:04:08 -07:00
Glenn Jocher 23718df1c6
Fix val `plots=plots` (#7524) 2022-04-21 18:21:01 -07:00
Glenn Jocher c9042dc2ad
Improved non-latin `Annotator()` plotting (#7488)
* Improved non-latin labels Annotator plotting

May resolve https://github.com/ultralytics/yolov5/issues/7460

* Update train.py

* Update train.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* add progress arg

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-04-19 17:32:15 -07:00
Glenn Jocher 4bb7eb8b84
Dynamic normalization layer selection (#7392)
* Dynamic normalization layer selection

Based on actual available layers. Torch 1.7 compatible, resolves https://github.com/ultralytics/yolov5/issues/7381

* Update train.py
2022-04-12 11:02:11 +02:00
Vardan Agarwal fa569cdae5
Add support for different normalization layers (#7377)
* Add support for different normalization layers.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Cleanup

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2022-04-11 14:04:22 +02:00
Glenn Jocher bd2dda8e64
Update optimizer param group strategy (#7376)
* Update optimizer param group strategy

Avoid empty lists on missing BathNorm2d models as in https://github.com/ultralytics/yolov5/issues/7375

* fix init
2022-04-11 12:34:35 +02:00
Glenn Jocher 5f941a84ef
Print dataset scan only `if RANK in (-1, 0)` (#7337)
* Print dataset scan only `if RANK in (-1, 0)`

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-04-07 16:44:08 +02:00
Glenn Jocher 245d6459a9
Add callbacks (#7315)
* Add `on_train_start()` callback

* Update

* Update
2022-04-06 17:23:34 +02:00
Glenn Jocher f735458987
Use `tqdm.auto` (#7311) 2022-04-06 12:20:24 +02:00
Glenn Jocher 2c3221844b
CLI `fire` prep updates (#7229)
* CLI fire prep updates

* revert unintentional TF export change
2022-03-31 17:11:43 +02:00
Jirka Borovec c3d5ac151e
precommit: yapf (#5494)
* precommit: yapf

* align isort

* fix

# Conflicts:
#	utils/plots.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update setup.cfg

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update setup.cfg

* Update setup.cfg

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update wandb_utils.py

* Update augmentations.py

* Update setup.cfg

* Update yolo.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update val.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* simplify colorstr

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* val run fix

* export.py last comma

* Update export.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update hubconf.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* PyTorch Hub tuple fix

* PyTorch Hub tuple fix2

* PyTorch Hub tuple fix3

* Update setup

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2022-03-31 16:52:34 +02:00
Glenn Jocher df9008ee69
Add train.py `--name cfg` option (#7202)
Automatically names run as --cfg argument
2022-03-31 13:17:22 +02:00
Glenn Jocher 47f265dde2
Update min warmup iterations from 1k to 100 (#6768) 2022-02-24 23:37:25 +01:00
Glenn Jocher 2692e67c5f
Updated VOC hyperparameters (#6732)
* Update hyps

* Update hyp.VOC.yaml

* Update pathlib

* Update hyps

* Update hyps

* Update hyps

* Update hyps
2022-02-22 12:11:18 +01:00
Glenn Jocher a936f5f219
Switch default LR scheduler from cos to linear (#6729)
* Switch default LR scheduler from cos to linear

Based on empirical results of training both ways on all YOLOv5 models.

* linear bug fix
2022-02-21 14:23:27 +01:00
Glenn Jocher 3670d91b05
Fix `--evolve --bucket gs://...` (#6698) 2022-02-18 19:15:37 +01:00
Glenn Jocher 7b80545e8e
Add `--cache val` (#6663)
New `--cache val` argument will cache validation set only into RAM. Should help multi-GPU training speeds without consuming as much RAM as full `--cache ram`.
2022-02-17 00:47:42 +01:00
Glenn Jocher 6769021901
Validate with 2x `--workers` (#6658) 2022-02-16 14:44:44 +01:00
Glenn Jocher a5c9057dcc
Update train.py 2022-02-10 14:15:18 +01:00
Christoph Fürbacher 9cf80b7f60
return `opt` from `train.run()` (#6581) 2022-02-09 15:11:52 +01:00
Matthias Vadcard f40854b61b
Allow custom` --evolve` project names (#6567)
* Update train.py

As see in #6463, modification on train in evolve process to allow custom save directory.

* fix val

* PEP8

whitespace around operator

* Cleanup

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2022-02-08 16:13:45 +01:00
Glenn Jocher 006eb40ab7
Improved AutoBatch DDP error message (#6568)
* Improved AutoBatch DDP error message

* Cleanup
2022-02-08 11:45:30 +01:00
bilzard aff0281969
Load checkpoint on CPU instead of on GPU (#6516)
* Load checkpoint on CPU instead of on GPU

* refactor: simplify code

* Cleanup

* Update train.py

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2022-02-04 18:58:18 +01:00
Ayush Chaurasia b73c62ebc5
W&B: Remember batchsize on resuming (#6512)
* log best.pt metrics at train end

* update

* Update __init__.py

* flush callbacks when using evolve

* remember batch size on resuming

* Update train.py

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2022-02-03 11:29:52 +01:00
Matthias 8efe97719c
Add `stop_training=False` flag to callbacks (#6365)
* New flag 'stop_training' in util.callbacks.Callbacks class to prematurely stop training from callback handler

* Removed most of the new  checks, leaving only the one after calling 'on_train_batch_end'

* Cleanup

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2022-01-22 16:37:21 -10:00
Ayush Chaurasia 9bcc32a5bf
Flush callbacks when on `--evolve` (#6374)
* log best.pt metrics at train end

* update

* Update __init__.py

* flush callbacks when using evolve

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2022-01-20 13:22:47 -10:00
Otfot db1f83be63
Fix `train.py` parameter groups desc error (#6318)
* Fix `train.py` parameter groups desc error

* Cleanup

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2022-01-16 20:58:34 -10:00
Glenn Jocher 33a67b4918
Update P2-P7 `models/hub` variants (#6230)
* Update p2-p7 `models/hub` variants

* Update common.py

* AutoAnchor camelcase corrections
2022-01-06 11:08:09 -08:00
Glenn Jocher ec4b6dd2a3
Update export format docstrings (#6151)
* Update export documentation

* Cleanup

* Update export.py

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update README.md

* Update README.md

* Update README.md

* Update train.py

* Update train.py

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-01-02 16:09:45 -08:00
bilzard e1dc894364
Enable AdamW optimizer (#6152) 2022-01-02 13:10:19 -08:00
Ayush Chaurasia db6ec66a60
W&B: track batch size after autobatch (#6039)
* track batch size after autobatch

* remove redundant import

* Update __init__.py

* Update __init__.py

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2021-12-23 14:23:50 +01:00
Glenn Jocher dc54ed5763
`--freeze` fix (#6044)
Fix for https://github.com/ultralytics/yolov5/issues/6038
2021-12-20 18:24:07 +01:00
Felix You 361705d9be
Multi-layer capable `--freeze` argument (#6019)
* support specfiy multiple frozen layers

* fix bug

* Cleanup Freeze section

* Cleanup argument

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2021-12-17 15:42:26 +01:00
Glenn Jocher 7c6bae0ae6
Remove NCOLS from tqdm (#5804)
* Remove NCOLS from tqdm

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2021-11-26 13:37:28 +01:00
Ayush Chaurasia f2ca30a407
W&B: refactor W&B tables (#5737)
* update

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* reformat

* Single-line argparser argument

* Update README.md

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update README.md

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2021-11-25 17:19:21 +01:00
Glenn Jocher 4ca4aec46f
Do not save hyp.yaml and opt.yaml on evolve (#5775)
* Do not save hyp.yaml and opt.yaml on evolve

* Update general.py
2021-11-24 23:25:51 +01:00
Glenn Jocher 47fac9ff73
Update train.py comment to 'Model attributes' (#5670) 2021-11-16 13:58:15 +01:00
Werner Duvaud 09d170381c
Default DataLoader `shuffle=True` for training (#5623)
* Fix shuffle DataLoader argument

* Add shuffle argument

* Disable shuffle when rect

* Cleanup, add rect warning

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Cleanup2

* Cleanup3

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2021-11-13 13:07:32 +01:00
Glenn Jocher 7473f0f95d
DDP `WORLD_SIZE`-safe dataloader workers (#5631)
* WORLD_SIZE-safe workers

* Update with DDP comment
2021-11-12 14:48:55 +01:00
Glenn Jocher 61c50199a2
Update train, val `tqdm` to fixed width (#5367)
* Update tqdm for fixed width

* Update val.py

* Update val.py

* Try ncols= in train.py

* NCOLS

* NCOLS

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* bar_format

* position 0 leave true

* exp0

* auto

* auto

* Cleanup

* Cleanup

* Cleanup

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2021-11-10 15:47:38 +01:00
Glenn Jocher 79bca2bf64
`LOGGER` consolidation (#5569)
* Logger consolidation

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2021-11-08 16:32:15 +01:00
Glenn Jocher e189fa15ea
`intersect_dicts()` in hubconf.py fix (#5542) 2021-11-06 15:41:17 +01:00
Glenn Jocher bcc085d83f
Common `is_coco` logic betwen train.py and val.py (#5521) 2021-11-05 13:32:46 +01:00