Commit Graph

235 Commits (3ce0db89b05e62b352befdadc33a148088a33e03)

Author SHA1 Message Date
Wei Quan 4c5d9bff80
Fix incorrect end epoch comment (#3612) 2021-06-15 11:24:56 +02:00
Glenn Jocher 4984cf54be
train.py GPU memory fix (#3590)
* train.py GPU memory fix

* ema

* cuda

* cuda

* zeros input

* to device

* batch index 0
2021-06-11 20:24:03 +02:00
Glenn Jocher 4695ca8314
Refactoring cleanup (#3565)
* Refactoring cleanup

* Update test.py
2021-06-09 22:50:27 +02:00
Glenn Jocher 5948f20a3d
Update test.py profiling (#3555)
* Update test.py profiling

* half_precision to half

* inplace
2021-06-09 16:25:17 +02:00
Glenn Jocher 63157d214d
Remove `is_coco` argument from `test()` (#3553) 2021-06-09 15:09:51 +02:00
Glenn Jocher 958ab92dc1
Remove `opt` from `create_dataloader()`` (#3552) 2021-06-09 13:14:56 +02:00
Glenn Jocher ef0b5c9d29
On-demand `pycocotools` pip install (#3547) 2021-06-09 11:22:21 +02:00
Glenn Jocher f3c3d2ce5d
Merge `develop` branch into `master` (#3518)
* update ci-testing.yml (#3322)

* update ci-testing.yml

* update greetings.yml

* bring back os matrix

* update ci-testing.yml (#3322)

* update ci-testing.yml

* update greetings.yml

* bring back os matrix

* Enable direct `--weights URL` definition (#3373)

* Enable direct `--weights URL` definition

@KalenMike this PR will enable direct --weights URL definition. Example use case:
```
python train.py --weights https://storage.googleapis.com/bucket/dir/model.pt
```

* cleanup

* bug fixes

* weights = attempt_download(weights)

* Update experimental.py

* Update hubconf.py

* return bug fix

* comment mirror

* min_bytes

* Update tutorial.ipynb (#3368)

add Open in Kaggle badge

* `cv2.imread(img, -1)` for IMREAD_UNCHANGED (#3379)

* Update datasets.py

* comment

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>

* COCO evolution fix (#3388)

* COCO evolution fix

* cleanup

* update print

* print fix

* Create `is_pip()` function (#3391)

Returns `True` if file is part of pip package. Useful for contextual behavior modification.

```python
def is_pip():
    # Is file in a pip package?
    return 'site-packages' in Path(__file__).absolute().parts
```

* Revert "`cv2.imread(img, -1)` for IMREAD_UNCHANGED (#3379)" (#3395)

This reverts commit 21a9607e00.

* Update FLOPs description (#3422)

* Update README.md

* Changing FLOPS to FLOPs.

Co-authored-by: BuildTools <unconfigured@null.spigotmc.org>

* Parse URL authentication (#3424)

* Parse URL authentication

* urllib.parse.unquote()

* improved error handling

* improved error handling

* remove %3F

* update check_file()

* Add FLOPs title to table (#3453)

* Suppress jit trace warning + graph once (#3454)

* Suppress jit trace warning + graph once

Suppress harmless jit trace warning on TensorBoard add_graph call. Also fix multiple add_graph() calls bug, now only on batch 0.

* Update train.py

* Update MixUp augmentation `alpha=beta=32.0` (#3455)

Per VOC empirical results https://github.com/ultralytics/yolov5/issues/3380#issuecomment-853001307 by @developer0hye

* Add `timeout()` class (#3460)

* Add `timeout()` class

* rearrange order

* Faster HSV augmentation (#3462)

remove datatype conversion process that can be skipped

* Add `check_git_status()` 5 second timeout (#3464)

* Add check_git_status() 5 second timeout

This should prevent the SSH Git bug that we were discussing @KalenMike

* cleanup

* replace timeout with check_output built-in timeout

* Improved `check_requirements()` offline-handling (#3466)

Improve robustness of `check_requirements()` function to offline environments (do not attempt pip installs when offline).

* Add `output_names` argument for ONNX export with dynamic axes (#3456)

* Add output names & dynamic axes for onnx export

Add output_names and dynamic_axes names for all outputs in torch.onnx.export. The first four outputs of the model will have names output0, output1, output2, output3

* use first output only + cleanup

Co-authored-by: Samridha Shrestha <samridha.shrestha@g42.ai>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>

* Revert FP16 `test.py` and `detect.py` inference to FP32 default (#3423)

* fixed inference bug ,while use half precision

* replace --use-half with --half

* replace space and PEP8 in detect.py

* PEP8 detect.py

* update --half help comment

* Update test.py

* revert space

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>

* Add additional links/resources to stale.yml message (#3467)

* Update stale.yml

* cleanup

* Update stale.yml

* reformat

* Update stale.yml HUB URL (#3468)

* Stale `github.actor` bug fix (#3483)

* Explicit `model.eval()` call `if opt.train=False` (#3475)

* call model.eval() when opt.train is False

call model.eval() when opt.train is False

* single-line if statement

* cleanup

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>

* check_requirements() exclude `opencv-python` (#3495)

Fix for 3rd party or contrib versions of installed OpenCV as in https://github.com/ultralytics/yolov5/issues/3494.

* Earlier `assert` for cpu and half option (#3508)

* early assert for cpu and half option

early assert for cpu and half option

* Modified comment

Modified comment

* Update tutorial.ipynb (#3510)

* Reduce test.py results spacing (#3511)

* Update README.md (#3512)

* Update README.md

Minor modifications

* 850 width

* Update greetings.yml

revert greeting change as PRs will now merge to master.

Co-authored-by: Piotr Skalski <SkalskiP@users.noreply.github.com>
Co-authored-by: SkalskiP <piotr.skalski92@gmail.com>
Co-authored-by: Peretz Cohen <pizzaz93@users.noreply.github.com>
Co-authored-by: tudoulei <34886368+tudoulei@users.noreply.github.com>
Co-authored-by: chocosaj <chocosaj@users.noreply.github.com>
Co-authored-by: BuildTools <unconfigured@null.spigotmc.org>
Co-authored-by: Yonghye Kwon <developer.0hye@gmail.com>
Co-authored-by: Sam_S <SamSamhuns@users.noreply.github.com>
Co-authored-by: Samridha Shrestha <samridha.shrestha@g42.ai>
Co-authored-by: edificewang <609552430@qq.com>
2021-06-08 10:22:10 +02:00
Glenn Jocher aad99b63d6
TensorBoard DP/DDP graph fix (#3325) 2021-05-25 11:45:24 +02:00
Charles Frye 19100ba007
Improves docs and handling of entities and resuming by WandbLogger (#3264)
* adds latest tag to match wandb defaults

* adds entity handling, 'last' tag

* fixes bug causing finished runs to resume

* removes redundant "last" tag for wandb artifact
2021-05-21 23:42:53 +02:00
Glenn Jocher dd7f0b7e05
Fix TypeError: 'PosixPath' object is not iterable (#3285) 2021-05-21 23:35:31 +02:00
Glenn Jocher 10d56d784e
Assert `--image-weights` not combined with DDP (#3275) 2021-05-21 14:46:42 +02:00
Glenn Jocher b7cd1f540d
TensorBoard add_graph() fix (#3236) 2021-05-19 13:51:55 +02:00
Glenn Jocher 60fe54449d
Update train.py (#3099) 2021-05-10 15:26:23 +02:00
Glenn Jocher a833ee2a46
Update check_requirements() exclude list (#2974) 2021-04-29 21:16:23 +02:00
Glenn Jocher f7bc685c2c
Implement yaml.safe_load() (#2876)
* Implement yaml.safe_load()

* yaml.safe_dump()
2021-04-21 14:34:45 +02:00
Burhan c949fc86d1
Detection cropping+saving feature addition for detect.py and PyTorch Hub (#2827)
* Update detect.py

* Update detect.py

* Update greetings.yml

* Update cropping

* cleanup

* Update increment_path()

* Update common.py

* Update detect.py

* Update detect.py

* Update detect.py

* Update common.py

* cleanup

* Update detect.py

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2021-04-20 23:51:08 +02:00
Glenn Jocher 6dd1083bbb
Tensorboard model visualization bug fix (#2758)
This fix should allow for visualizing YOLOv5 model graphs correctly in Tensorboard by uncommenting line 335 in train.py:
```python
                    if tb_writer:
                        tb_writer.add_graph(torch.jit.trace(model, imgs, strict=False), [])  # add model graph
```

The problem was that the detect() layer checks the input size to adapt the grid if required, and tracing does not seem to like this shape check (even if the shape is fine and no grid recomputation is required). The following will warn:
0cae7576a9/train.py (L335)

Solution is below. This is a YOLOv5s model displayed in TensorBoard. You can see the Detect() layer merging the 3 layers into a single output for example, and everything appears to work and visualize correctly.
```python
tb_writer.add_graph(torch.jit.trace(model, imgs, strict=False), [])
```
<img width="893" alt="Screenshot 2021-04-11 at 01 10 09" src="https://user-images.githubusercontent.com/26833433/114286928-349bd600-9a63-11eb-941f-7139ee6cd602.png">
2021-04-11 01:33:55 +02:00
Ding Yiwei 1148e2ea63
Add TransformerLayer, TransformerBlock, C3TR modules (#2333)
* yolotr

* transformer block

* Remove bias in Transformer

* Remove C3T

* Remove a deprecated class

* put the 2nd LayerNorm into the 2nd residual block

* move example model to models/hub, rename to -transformer

* Add module comments and TODOs

* Remove LN in Transformer

* Add comments for Transformer

* Solve the problem of MA with DDP

* cleanup

* cleanup find_unused_parameters

* PEP8 reformat

Co-authored-by: DingYiwei <846414640@qq.com>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2021-04-01 17:26:53 +02:00
Phat Tran 9c803f2f7e
Add --label-smoothing eps argument to train.py (default 0.0) (#2344)
* Add label smoothing option

* Correct data type

* add_log

* Remove log

* Add log

* Update loss.py

remove comment (too versbose)

Co-authored-by: phattran <phat.tranhoang@cyberlogitec.com>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2021-03-29 18:45:46 +02:00
Ayush Chaurasia 518c09578e
W&B resume ddp from run link fix (#2579)
* W&B resume ddp from run link fix

* Native DDP W&B support for training, resuming
2021-03-28 16:11:36 +02:00
Ayush Chaurasia dc51e80b00
Fix: evolve with wandb (#2634) 2021-03-28 16:09:35 +02:00
Glenn Jocher 9f98201dd9
W&B DDP fix 2 (#2587)
Revert unintentional change to test batch sizes caused by PR https://github.com/ultralytics/yolov5/pull/2125
2021-03-24 15:43:32 +01:00
Glenn Jocher e5b0200cd2
Update tensorboard>=2.4.1 (#2576)
* Update tensorboard>=2.4.1 

Update tensorboard version to attempt to address https://github.com/ultralytics/yolov5/issues/2573 (tensorboard logging fail in Docker image).

* cleanup
2021-03-24 01:29:00 +01:00
Ayush Chaurasia 1bf9365280
W&B DDP fix (#2574) 2021-03-23 16:54:34 +01:00
Ayush Chaurasia e8fc97aa38
Improved W&B integration (#2125)
* Init Commit

* new wandb integration

* Update

* Use data_dict in test

* Updates

* Update: scope of log_img

* Update: scope of log_img

* Update

* Update: Fix logging conditions

* Add tqdm bar, support for .txt dataset format

* Improve Result table Logger

* Init Commit

* new wandb integration

* Update

* Use data_dict in test

* Updates

* Update: scope of log_img

* Update: scope of log_img

* Update

* Update: Fix logging conditions

* Add tqdm bar, support for .txt dataset format

* Improve Result table Logger

* Add dataset creation in training script

* Change scope: self.wandb_run

* Add wandb-artifact:// natively

you can now use --resume with wandb run links

* Add suuport for logging dataset while training

* Cleanup

* Fix: Merge conflict

* Fix: CI tests

* Automatically use wandb config

* Fix: Resume

* Fix: CI

* Enhance: Using val_table

* More resume enhancement

* FIX : CI

* Add alias

* Get useful opt config data

* train.py cleanup

* Cleanup train.py

* more cleanup

* Cleanup| CI fix

* Reformat using PEP8

* FIX:CI

* rebase

* remove uneccesary changes

* remove uneccesary changes

* remove uneccesary changes

* remove unecessary chage from test.py

* FIX: resume from local checkpoint

* FIX:resume

* FIX:resume

* Reformat

* Performance improvement

* Fix local resume

* Fix local resume

* FIX:CI

* Fix: CI

* Imporve image logging

* (:(:Redo CI tests:):)

* Remember epochs when resuming

* Remember epochs when resuming

* Update DDP location

Potential fix for #2405

* PEP8 reformat

* 0.25 confidence threshold

* reset train.py plots syntax to previous

* reset epochs completed syntax to previous

* reset space to previous

* remove brackets

* reset comment to previous

* Update: is_coco check, remove unused code

* Remove redundant print statement

* Remove wandb imports

* remove dsviz logger from test.py

* Remove redundant change from test.py

* remove redundant changes from train.py

* reformat and improvements

* Fix typo

* Add tqdm tqdm progress when scanning files, naming improvements

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2021-03-23 00:44:50 +01:00
Glenn Jocher 08d4918d7f
labels.jpg class names (#2454)
* labels.png class names

* fontsize=10
2021-03-12 22:15:41 -08:00
Glenn Jocher f01f3223d5
Integer printout (#2450)
* Integer printout

* test.py 'Labels'

* Update train.py
2021-03-12 13:35:44 -08:00
Glenn Jocher 886f1c03d8
DDP after autoanchor reorder (#2421) 2021-03-09 23:43:46 -08:00
Glenn Jocher e931b9da33
Resume with custom anchors fix (#2361)
* Resume with custom anchors fix

* Update train.py
2021-03-03 21:06:36 -08:00
Glenn Jocher a3ecf0fd64
Anchor override (#2350) 2021-03-02 23:08:21 -08:00
Glenn Jocher fab5085674
EMA bug fix 2 (#2330)
* EMA bug fix 2

* update
2021-03-01 17:13:34 -08:00
Glenn Jocher dfeec198cb
final_epoch EMA bug fix (#2317) 2021-02-27 12:51:33 -08:00
Jan Hajek efa4946d15
W&B entity support (#2298)
* W&B entity support

* shorten wandb_entity to entity

Co-authored-by: Jan Hajek <jan.hajek@gmail.com>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2021-02-25 19:18:19 -08:00
Glenn Jocher 71dd2768f2
Improved model+EMA checkpointing 2 (#2295) 2021-02-24 21:03:21 -08:00
Glenn Jocher ec1d8496ba
Improved model+EMA checkpointing (#2292)
* Enhanced model+EMA checkpointing

* update

* bug fix

* bug fix 2

* always save optimizer

* ema half

* remove model.float()

* model half

* carry ema/model in fp32

* rm model.float()

* both to float always

* cleanup

* cleanup
2021-02-24 18:26:46 -08:00
Glenn Jocher ca5b10b759
Update train.py (#2290)
* Update train.py

* Update train.py

* Update train.py

* Update train.py

* Create train.py
2021-02-24 13:31:20 -08:00
Glenn Jocher e27ca0d845
Update minimum stride to 32 (#2266) 2021-02-21 21:46:42 -08:00
Glenn Jocher 6b634c6b87
Linear LR scheduler option (#2150)
* Linear LR scheduler option

* Update train.py
2021-02-06 11:26:54 -08:00
Glenn Jocher ad839eda38
Update train.py (#2149) 2021-02-06 11:21:04 -08:00
Glenn Jocher 86897e3663
Update train.py test batch_size (#2148)
* Update train.py

* Update loss.py
2021-02-06 10:29:32 -08:00
Glenn Jocher 2acbe9699a
W&B epoch logging update (#2073) 2021-01-28 18:57:24 -08:00
Glenn Jocher f639e14e4d
Metric-Confidence plots feature addition (#2057)
* Metric-Confidence plots feature addition

* cleanup

* Metric-Confidence plots feature addition

* cleanup

* Update run-once lines

* cleanup

* save all 4 curves to wandb
2021-01-27 17:10:53 -08:00
Glenn Jocher 59c21c7bcb
W&B log epoch (#1946)
* W&B log epoch

* capitalize

* W&B log epoch

* capitalize

* Update train.py

New try using https://docs.wandb.ai/library/log#incremental-logging

* Update train.py

* Update test.py

* Update train.py

* Update plots.py

* Update train.py

* Update train.py

* label plot step -1

* update

* update

* update

* update

* update

* update

* Update train.py

* Update train.py
2021-01-26 21:16:01 -08:00
Glenn Jocher 046c37e465
verbose on final_epoch (#1997) 2021-01-20 18:27:38 -08:00
Abhiram V e9941d50fa
Update train.py with yaml.SafeLoader (#1972) 2021-01-18 10:49:08 -08:00
huntr.dev | the place to protect open source b5d851d653
Security Fix for Arbitrary Code Execution - huntr.dev (#1962)
Co-authored-by: Anon-Artist <61599526+Anon-Artist@users.noreply.github.com>
Co-authored-by: Jamie Slome <jamie@418sec.com>
2021-01-17 14:10:16 -08:00
Glenn Jocher ca9babb8e6
Add ComputeLoss() class (#1950) 2021-01-15 13:50:24 -08:00
Glenn Jocher f4a78e1b40
W&B mosaic log bug fix (#1949) 2021-01-15 12:09:53 -08:00
Glenn Jocher 777032efbc
Daemon thread mosaic plots fix (#1943) 2021-01-14 13:16:48 -08:00