Commit Graph

424 Commits (5a28cf9ee98a5f7ac4d8cc5be1b1f6aea2cfcd77)

Author SHA1 Message Date
Glenn Jocher a75a1105a1
Self-contained checkpoint `--resume` (#8839)
* Single checkpoint resume

* Update train.py

* Add hyp

* Add hyp

* Add hyp

* FIX

* avoid resume on url data

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

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

* avoid resume on url data

* avoid resume on url data

* Update

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-08-03 21:28:22 +02:00
Glenn Jocher 08c8c3e00a
New `smart_resume()` (#8838)
* New `smart_resume()`

* Update torch_utils.py

* Update torch_utils.py

* Update torch_utils.py

* fix
2022-08-02 15:13:58 +02:00
Glenn Jocher f3c78a387e
Remove hook `torch.nan_to_num(x)` (#8826)
* Remove hook `torch.nan_to_num(x)`

Observed erratic training behavior (green line) with the nan_to_num hook in classifier branch. I'm going to remove it from master.

* Update train.py
2022-08-01 21:39:04 +02:00
UnglvKitDe 0669f1b27b
Add tensor hooks and 10.0 gradient clipping (#8598)
* Add tensor hooks and gradient clipping https://github.com/ultralytics/yolov5/issues/8578

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

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

* Remove retain_grad(), because its not necessary

* Update train.py

* Simplify

* Update train.py

* Update train.py

* Update train.py

* Update train.py

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-08-01 12:08:46 +02:00
Glenn Jocher 59595c1365
Update train.py for `val.run(half=amp)` (#8804)
Disable FP16 validation if AMP checks fail or amp=False.
2022-07-31 04:17:39 +02:00
Glenn Jocher 9cf5fd5ac3
assert torch!=1.12.0 for DDP training (#8621)
* assert torch!=1.12.0 for DDP training

* [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-07-18 15:05:58 +02:00
Glenn Jocher 51fb467b63
Refactor optimizer initialization (#8607)
* Refactor optimizer initialization

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

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

* Update train.py

* Update train.py

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-07-17 11:43:52 +02:00
Yonghye Kwon 7204c1ca25
Explicitly set `weight_decay` value (#8592)
* explicitly set weight_decay value

The default weight_decay value of AdamW is 1e-2, so we should set it to zero.

* [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-07-16 15:51:48 +02:00
Ayush Chaurasia 27d831b6e4
Training reproducibility improvements (#8213)
* attempt at reproducibility

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

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

* use deterministic algs

* fix everything :)

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

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

* revert dataloader changes

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

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

* process_batch as np

* remove newline

* Remove dataloader init fcn

* Update val.py

* Update train.py

* revert additional changes

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

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

* Update train.py

* Add --seed arg

* Update general.py

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

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

* Update train.py

* Update train.py

* Update val.py

* Update train.py

* Update general.py

* Update general.py

* Add deterministic argument to init_seeds()

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-07-07 14:39:29 +02:00
Amir Pourmand e50dc38d36
Improve `--local_rank` arg comment (#8409)
* add more docs

* add more docs

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

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

* Update train.py

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-06-30 15:01:31 +02:00
Giacomo Guiduzzi 6935a54e60
Implementation of Early Stopping for DDP training (#8345)
* Implementation of Early Stopping for DDP training

This edit correctly uses the broadcast_object_list() function to send slave processes a boolean so to end the training phase if the variable is True, thus allowing the master process to destroy the process group and terminate.

* Update train.py

* Update train.py

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

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

* Update train.py

* Update train.py

* Update train.py

* Further cleanup

This cleans up the definition of broadcast_list and removes the requirement for clear() afterward.

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>
2022-06-29 12:41:46 +02:00
Glenn Jocher 8ebf569d14
Fix bias warmup LR init (#8356)
Per https://github.com/ultralytics/yolov5/issues/8352
2022-06-27 16:11:24 +02:00
Glenn Jocher dcf8073881
Simplify and fix `--save-period` epoch 0 (#8042)
Simplify and update `--save-period` epoch 0
2022-05-30 12:42:12 +02:00
Glenn Jocher eb1217f3ac
Add PyTorch AMP check (#7917)
* Add PyTorch AMP check

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

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

* Cleanup

* Cleanup

* Cleanup

* Robust for DDP

* Fixes

* Add amp enabled boolean to check_train_batch_size

* Simplify

* space to prefix

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-05-22 13:41:18 +02:00
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
Yonghye Kwon 99a45bad81
Write date in checkpoint file (#5514)
* write date in checkpoint file

write date in checkpoint file

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

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

* isoformat

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-05 11:48:10 +01:00
Jirka Borovec 0155548384
precommit: isort (#5493)
* precommit: isort

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

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

* Update isort config

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

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

* Update name

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-04 17:24:25 +01:00
Glenn Jocher 5866646cc8
Fix float zeros format (#5491)
* Fix float zeros format

* 255 to integer
2021-11-03 23:36:53 +01:00
Glenn Jocher 7b1f7aec46
Update `get_loggers()` (#4854)
* Update `set_logging()`

* Update export.py

* pre-commit fixes

* Update LoadImages

* Update LoadStreams

* Update print_args

* Single LOGGER definition

* yolo.py fix

Co-authored-by: pre-commit <pre-commit@example.com>
2021-11-01 18:22:13 +01:00
Glenn Jocher a4fece8c14
DDP `nl` fix (#5332) 2021-10-25 16:03:39 +02:00
Glenn Jocher ca19df5f7f
Add `autobatch` feature for best `batch-size` estimation (#5092)
* Autobatch

* fix mem

* fix mem2

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update train.py

* print result

* Cleanup print result

* swap fix in call

* to 64

* use total

* fix

* fix

* fix

* fix

* fix

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Cleanup printing

* Update final printout

* Update autobatch.py

* Update autobatch.py

* Update autobatch.py
2021-10-25 13:56:13 +02:00
Glenn Jocher 752d97df2c
Add `on_fit_epoch_end` callback (#5232)
* Add `on_fit_epoch_end` callback

* Add results to train

* Update __init__.py
2021-10-18 14:28:22 +02:00
Malte Lorbach 153873e9e4
Fix `ROOT` as relative path (#5129)
* use os.path.relpath instead of relative_to

* use os.path.relpath instead of relative_to

* Remove os.path from val.py

* Remove os.path from train.py

* Update detect.py import to os

* Update export.py import to os

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2021-10-11 09:47:24 -07:00
Nan 4a6dfffdaa
Pass `LOCAL_RANK` to `torch_distributed_zero_first()` (#5114)
Co-authored-by: qiningonline <qiningonline@gmail.com>
2021-10-09 18:41:50 -07:00
Glenn Jocher 070af88108
Fix `yaml.safe_load()` ignore emoji errors (#5060) 2021-10-05 13:41:52 -07:00
Glenn Jocher 5afc9c25ef
Implement `--save-period` locally (#5047)
This PR adds a new training argument `--save-period` to save training checkpoints every `x` epochs. To save training every 50 epochs for example:
```
python train.py --save-period 50  # saves epoch50.pt, epoch100.pt, epoch150.pt, ... etc.
```

This saved checkpoints in addition to existing last.pt and best.pt checkpoints and does not affect their behavior. Default value is -1, i.e. disabled.
2021-10-04 18:48:46 -07:00
Zhiqiang Wang 1922ddeac0
Fix pylint: do not use bare 'except' (#5025)
* Fix E722, do not use bare 'except'

* Remove used codes

* Add FileNotFoundError in LoadImagesAndLabels

* Remove AssertionError

* Ignore LoadImagesAndLabels

* Ignore downloads.py

* Ignore torch_utils.py

* Ignore train.py

* Ignore datasets.py

* Enable utils/download.py

* Fixing exception in thop

* Remove unused code

* Fixing exception in LoadImagesAndLabels

* Fixing exception in exif_size

* Fixing exception in parse_model

* Ignore exceptions in requests

* Revert the exception as suggested

* Revert the exception as suggested
2021-10-03 17:54:40 -07:00
Glenn Jocher 89a6e9ffa7
Compute loss on final val (#5017) 2021-09-30 15:16:11 -07:00
Glenn Jocher 452e84703c
Update train.py (#5014) 2021-09-30 13:57:53 -07:00
Glenn Jocher 4e04cb0dc8
Allow YOLOv5 execution from arbitrary `cwd` (#4954)
* Allow YOLOv5 execution from arbitrary `cwd`

* Fix str bugs
2021-09-27 17:40:20 -07:00
Glenn Jocher d856c48298
Validate `best.pt` on train end (#4889)
* Validate best.pt on train end

* 0.7 iou for COCO only

* pass callbacks

* active model.float() if not half

* print Validating best.pt...

* add newline
2021-09-26 11:54:53 -07:00
Glenn Jocher 2b3109eeb0
Fix DDP destruction `LOGGER.info()` (#4863) 2021-09-20 13:12:48 +02:00
Glenn Jocher 4c839eeb10
Simplify `check_requirements()` usage (#4855)
* Simplify `check_requirements()` usage

* remove assert, print()
2021-09-18 18:34:30 +02:00
Glenn Jocher 4d1a2ac87e
Update `sys.path.append(str(ROOT))` (#4852)
* Update `sys.path.append(str(ROOT))`

* Cleanup
2021-09-18 15:02:08 +02:00
Glenn Jocher 3732f9ac8a
Refactor argparser printing to `print_args()` (#4850)
* Refactor argparser printing to `print_args()`

* Cleanup
2021-09-18 14:16:19 +02:00
Glenn Jocher 621b6d5ba8
Evolution `--resume` fix (#4802)
Also disable `/weights` dir creation when evolving as no weights are saved and empty folder causes user expectations of weights.
2021-09-15 13:13:33 +02:00
Glenn Jocher c47be26f34
Replace `path.absolute()` with `path.resolve()` (#4763) 2021-09-11 22:46:33 +02:00
Glenn Jocher c5360f6e70
Fix `--data from_HUB.zip` (#4732)
@KalenMike
2021-09-09 18:01:59 +02:00
Glenn Jocher a2b3c71636
Add suffix checks (#4711)
* Add suffix checks

* Cleanup

* Cleanup2

* Cleanup3
2021-09-08 14:36:12 +02:00
Kalen Michael 2317f86ca4
Optimised Callback Class to Reduce Code and Fix Errors (#4688)
* added callbacks

* added back callback to main

* added save_dir to callback output

* reduced code count

* updated callbacks

* added default callback class to main, added missing parameters to on_model_save

* Glenn updates

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2021-09-07 18:32:15 +02:00
Glenn Jocher 548745181a
EarlyStopper updates (#4679) 2021-09-05 19:09:53 +02:00
imyhxy f64fab5825
Fixed 'meta' and 'hyp' may out of order when using evolve (#4657)
* Fixed 'meta' and 'hyp' may out of order when using evolve

* Update gitignore
2021-09-05 17:43:09 +02:00
Glenn Jocher 50a9828679
DDP `torch.jit.trace()` `--sync-bn` fix (#4615)
* Remove assert

* debug0

* trace=not opt.sync

* sync to sync_bn fix

* Cleanup
2021-08-30 18:35:07 +02:00
Glenn Jocher de44376d1b
Create `Annotator()` class (#4591)
* Add Annotator() class

* Download Arial

* 2x for loop

* Cleanup

* tuple 2 list

* max_size=1920

* bold logging results to

* tolist()

* im = annotator.im

* PIL save in detect.py

* Smart asarray in detect.py

* revert to cv2.imwrite

* Cleanup

* Return result asarray

* Add `Profile()` profiler

* CamelCase Timeout

* Resize after mosaic

* pillow>=8.0.0

* daemon imwrite

* Add cv2 support

* Remove plot_wh_methods and plot_one_box

* pil=False for hubconf.py annotations

* im.shape bug fix

* colorstr common.py

* join daemons

* Update t.daemon

* Removed daemon saving
2021-08-29 16:46:13 +02:00
Glenn Jocher d7aa3f153d
Remove `image_weights` DDP code (#4579)
* Initial commit

* Update
2021-08-28 19:17:21 +02:00
Glenn Jocher 93cc015748
Add EarlyStopping feature (#4576)
* Add EarlyStopping feature

* Add comment

* Cleanup

* Cleanup2

* debug

* debug2

* debug3

* debug3

* debug4

* debug5

* debug6

* debug7

* debug8

* debug9

* debug10

* debug11

* debug12

* Cleanup

* Add TODO for known DDP issue
2021-08-28 19:03:52 +02:00
Glenn Jocher 19d03a955c
Remove DDP process group timeout (#4422) 2021-08-15 18:32:41 +02:00
Glenn Jocher 24bea5e4b7
Standardize headers and docstrings (#4417)
* Implement new headers

* Reformat 1

* Reformat 2

* Reformat 3 - math

* Reformat 4 - yaml
2021-08-14 21:17:51 +02:00
Glenn Jocher ce7deec440
`int(mlc)` (#4385) 2021-08-11 17:32:13 +02:00
Glenn Jocher 86c7150cfd
Update newline (#4308) 2021-08-04 17:41:38 +02:00
Glenn Jocher e78aeac973
Evolve in CSV format (#4307)
* Update evolution to CSV format

* Update

* Update

* Update

* Update

* Update

* reset args

* reset args

* reset args

* plot_results() fix

* Cleanup

* Cleanup2
2021-08-04 17:13:38 +02:00