diff --git a/README.md b/README.md
index b669724e7310..fc09cfc94ff5 100755
--- a/README.md
+++ b/README.md
@@ -25,8 +25,8 @@ This repository represents Ultralytics open-source research into future object d
** APtest denotes COCO [test-dev2017](http://cocodataset.org/#upload) server results, all other AP results in the table denote val2017 accuracy.
-** All AP numbers are for single-model single-scale without ensemble or test-time augmentation. Reproduce by `python test.py --data data/coco.yaml --img 736 --conf 0.001`
-** SpeedGPU measures end-to-end time per image averaged over 5000 COCO val2017 images using a GCP [n1-standard-16](https://cloud.google.com/compute/docs/machine-types#n1_standard_machine_types) instance with one V100 GPU, and includes image preprocessing, PyTorch FP16 image inference at --batch-size 32 --img-size 640, postprocessing and NMS. Average NMS time included in this chart is 1-2ms/img. Reproduce by `python test.py --data data/coco.yaml --img 640 --conf 0.1`
+** All AP numbers are for single-model single-scale without ensemble or test-time augmentation. Reproduce by `python test.py --data coco.yaml --img 736 --conf 0.001`
+** SpeedGPU measures end-to-end time per image averaged over 5000 COCO val2017 images using a GCP [n1-standard-16](https://cloud.google.com/compute/docs/machine-types#n1_standard_machine_types) instance with one V100 GPU, and includes image preprocessing, PyTorch FP16 image inference at --batch-size 32 --img-size 640, postprocessing and NMS. Average NMS time included in this chart is 1-2ms/img. Reproduce by `python test.py --data coco.yaml --img 640 --conf 0.1`
** All checkpoints are trained to 300 epochs with default settings and hyperparameters (no autoaugmentation).
@@ -41,7 +41,7 @@ $ pip install -U -r requirements.txt
## Tutorials
* [Notebook](https://github.com/ultralytics/yolov5/blob/master/tutorial.ipynb)
-* [Kaggle](https://www.kaggle.com/ultralytics/yolov5-tutorial)
+* [Kaggle](https://www.kaggle.com/ultralytics/yolov5)
* [Train Custom Data](https://github.com/ultralytics/yolov5/wiki/Train-Custom-Data)
* [PyTorch Hub](https://github.com/ultralytics/yolov5/issues/36)
* [ONNX and TorchScript Export](https://github.com/ultralytics/yolov5/issues/251)
diff --git a/requirements.txt b/requirements.txt
index bca726aa33f0..0deceacc74fb 100755
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,6 +1,6 @@
# pip install -U -r requirements.txt
Cython
-numpy==1.17
+numpy==1.17.3
opencv-python
torch>=1.5.1
matplotlib
diff --git a/train.py b/train.py
index f42479094ea5..e423a2b09c41 100644
--- a/train.py
+++ b/train.py
@@ -208,15 +208,15 @@ def train(hyp, tb_writer, opt, device):
model.names = names
# Class frequency
+ labels = np.concatenate(dataset.labels, 0)
+ c = torch.tensor(labels[:, 0]) # classes
+ # cf = torch.bincount(c.long(), minlength=nc) + 1.
+ # model._initialize_biases(cf.to(device))
+ plot_labels(labels, save_dir=log_dir)
if tb_writer:
- labels = np.concatenate(dataset.labels, 0)
- c = torch.tensor(labels[:, 0]) # classes
- # cf = torch.bincount(c.long(), minlength=nc) + 1.
- # model._initialize_biases(cf.to(device))
- plot_labels(labels)
+ tb_writer.add_hparams(hyp, {})
tb_writer.add_histogram('classes', c, 0)
-
# Check anchors
if not opt.noautoanchor:
check_anchors(dataset, model=model, thr=hyp['anchor_t'], imgsz=imgsz)
diff --git a/utils/datasets.py b/utils/datasets.py
index 3d724e6fae62..2da3940c3c95 100755
--- a/utils/datasets.py
+++ b/utils/datasets.py
@@ -59,7 +59,7 @@ def create_dataloader(path, imgsz, batch_size, stride, opt, hyp=None, augment=Fa
pad=pad)
batch_size = min(batch_size, len(dataset))
- nw = min([os.cpu_count()//opt.world_size, batch_size if batch_size > 1 else 0, 8]) # number of workers
+ nw = min([os.cpu_count()//(opt.world_size if hasattr(opt, "world_size") else 1), batch_size if batch_size > 1 else 0, 8]) # number of workers
train_sampler = torch.utils.data.distributed.DistributedSampler(dataset) if local_rank != -1 else None
dataloader = torch.utils.data.DataLoader(dataset,
batch_size=batch_size,