glenn-jocher
commited on
Commit
β’
ac8691e
1
Parent(s):
78cf488
Created using Colaboratory
Browse files- tutorial.ipynb +17 -87
tutorial.ipynb
CHANGED
@@ -917,93 +917,23 @@
|
|
917 |
"colab": {
|
918 |
"base_uri": "https://localhost:8080/"
|
919 |
},
|
920 |
-
"outputId": "
|
921 |
},
|
922 |
"source": [
|
923 |
"# Train YOLOv5s on COCO128 for 3 epochs\n",
|
924 |
"!python train.py --img 640 --batch 16 --epochs 3 --data coco128.yaml --weights yolov5s.pt --cache"
|
925 |
],
|
926 |
-
"execution_count":
|
927 |
"outputs": [
|
928 |
{
|
929 |
"output_type": "stream",
|
930 |
"text": [
|
931 |
"\u001b[34m\u001b[1mgithub: \u001b[0mup to date with https://github.com/ultralytics/yolov5 β
\n",
|
932 |
-
"YOLOv5 π v5.0-
|
933 |
-
"\n",
|
934 |
-
"Namespace(adam=False, artifact_alias='latest', batch_size=16, bbox_interval=-1, bucket='', cache_images=True, cfg='', data='./data/coco128.yaml', device='', entity=None, epochs=1, evolve=False, exist_ok=False, global_rank=-1, hyp='data/hyp.scratch.yaml', image_weights=False, img_size=[640, 640], label_smoothing=0.0, linear_lr=False, local_rank=-1, multi_scale=False, name='exp', noautoanchor=False, nosave=False, notest=False, project='runs/train', quad=False, rect=False, resume=False, save_dir='runs/train/exp', save_period=-1, single_cls=False, sync_bn=False, total_batch_size=16, upload_dataset=False, weights='yolov5s.pt', workers=8, world_size=1)\n",
|
935 |
-
"\u001b[34m\u001b[1mtensorboard: \u001b[0mStart with 'tensorboard --logdir runs/train', view at http://localhost:6006/\n",
|
936 |
-
"2021-06-08 16:52:25.719745: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Successfully opened dynamic library libcudart.so.11.0\n",
|
937 |
-
"\u001b[34m\u001b[1mhyperparameters: \u001b[0mlr0=0.01, lrf=0.2, momentum=0.937, weight_decay=0.0005, warmup_epochs=3.0, warmup_momentum=0.8, warmup_bias_lr=0.1, box=0.05, cls=0.5, cls_pw=1.0, obj=1.0, obj_pw=1.0, iou_t=0.2, anchor_t=4.0, fl_gamma=0.0, hsv_h=0.015, hsv_s=0.7, hsv_v=0.4, degrees=0.0, translate=0.1, scale=0.5, shear=0.0, perspective=0.0, flipud=0.0, fliplr=0.5, mosaic=1.0, mixup=0.0\n",
|
938 |
-
"\u001b[34m\u001b[1mwandb: \u001b[0mInstall Weights & Biases for YOLOv5 logging with 'pip install wandb' (recommended)\n",
|
939 |
-
"Downloading https://github.com/ultralytics/yolov5/releases/download/v5.0/yolov5s.pt to yolov5s.pt...\n",
|
940 |
-
"100% 14.1M/14.1M [00:00<00:00, 18.7MB/s]\n",
|
941 |
-
"\n",
|
942 |
-
"\n",
|
943 |
-
" from n params module arguments \n",
|
944 |
-
" 0 -1 1 3520 models.common.Focus [3, 32, 3] \n",
|
945 |
-
" 1 -1 1 18560 models.common.Conv [32, 64, 3, 2] \n",
|
946 |
-
" 2 -1 1 18816 models.common.C3 [64, 64, 1] \n",
|
947 |
-
" 3 -1 1 73984 models.common.Conv [64, 128, 3, 2] \n",
|
948 |
-
" 4 -1 1 156928 models.common.C3 [128, 128, 3] \n",
|
949 |
-
" 5 -1 1 295424 models.common.Conv [128, 256, 3, 2] \n",
|
950 |
-
" 6 -1 1 625152 models.common.C3 [256, 256, 3] \n",
|
951 |
-
" 7 -1 1 1180672 models.common.Conv [256, 512, 3, 2] \n",
|
952 |
-
" 8 -1 1 656896 models.common.SPP [512, 512, [5, 9, 13]] \n",
|
953 |
-
" 9 -1 1 1182720 models.common.C3 [512, 512, 1, False] \n",
|
954 |
-
" 10 -1 1 131584 models.common.Conv [512, 256, 1, 1] \n",
|
955 |
-
" 11 -1 1 0 torch.nn.modules.upsampling.Upsample [None, 2, 'nearest'] \n",
|
956 |
-
" 12 [-1, 6] 1 0 models.common.Concat [1] \n",
|
957 |
-
" 13 -1 1 361984 models.common.C3 [512, 256, 1, False] \n",
|
958 |
-
" 14 -1 1 33024 models.common.Conv [256, 128, 1, 1] \n",
|
959 |
-
" 15 -1 1 0 torch.nn.modules.upsampling.Upsample [None, 2, 'nearest'] \n",
|
960 |
-
" 16 [-1, 4] 1 0 models.common.Concat [1] \n",
|
961 |
-
" 17 -1 1 90880 models.common.C3 [256, 128, 1, False] \n",
|
962 |
-
" 18 -1 1 147712 models.common.Conv [128, 128, 3, 2] \n",
|
963 |
-
" 19 [-1, 14] 1 0 models.common.Concat [1] \n",
|
964 |
-
" 20 -1 1 296448 models.common.C3 [256, 256, 1, False] \n",
|
965 |
-
" 21 -1 1 590336 models.common.Conv [256, 256, 3, 2] \n",
|
966 |
-
" 22 [-1, 10] 1 0 models.common.Concat [1] \n",
|
967 |
-
" 23 -1 1 1182720 models.common.C3 [512, 512, 1, False] \n",
|
968 |
-
" 24 [17, 20, 23] 1 229245 models.yolo.Detect [80, [[10, 13, 16, 30, 33, 23], [30, 61, 62, 45, 59, 119], [116, 90, 156, 198, 373, 326]], [128, 256, 512]]\n",
|
969 |
-
"Model Summary: 283 layers, 7276605 parameters, 7276605 gradients, 17.1 GFLOPs\n",
|
970 |
-
"\n",
|
971 |
-
"Transferred 362/362 items from yolov5s.pt\n",
|
972 |
-
"\n",
|
973 |
-
"WARNING: Dataset not found, nonexistent paths: ['/content/coco128/images/train2017']\n",
|
974 |
-
"Downloading https://github.com/ultralytics/yolov5/releases/download/v1.0/coco128.zip ...\n",
|
975 |
-
"100% 21.1M/21.1M [00:00<00:00, 68.2MB/s]\n",
|
976 |
-
"Dataset autodownload success\n",
|
977 |
-
"\n",
|
978 |
-
"Scaled weight_decay = 0.0005\n",
|
979 |
-
"Optimizer groups: 62 .bias, 62 conv.weight, 59 other\n",
|
980 |
-
"\u001b[34m\u001b[1mtrain: \u001b[0mScanning '../coco128/labels/train2017' images and labels...128 found, 0 missing, 2 empty, 0 corrupted: 100% 128/128 [00:00<00:00, 2036.51it/s]\n",
|
981 |
-
"\u001b[34m\u001b[1mtrain: \u001b[0mNew cache created: ../coco128/labels/train2017.cache\n",
|
982 |
-
"\u001b[34m\u001b[1mtrain: \u001b[0mCaching images (0.1GB): 100% 128/128 [00:00<00:00, 189.76it/s]\n",
|
983 |
-
"\u001b[34m\u001b[1mval: \u001b[0mScanning '../coco128/labels/train2017.cache' images and labels... 128 found, 0 missing, 2 empty, 0 corrupted: 100% 128/128 [00:00<00:00, 687414.74it/s]\n",
|
984 |
-
"\u001b[34m\u001b[1mval: \u001b[0mCaching images (0.1GB): 100% 128/128 [00:01<00:00, 93.37it/s]\n",
|
985 |
-
"Plotting labels... \n",
|
986 |
-
"\n",
|
987 |
-
"\u001b[34m\u001b[1mautoanchor: \u001b[0mAnalyzing anchors... anchors/target = 4.26, Best Possible Recall (BPR) = 0.9946\n",
|
988 |
-
"Image sizes 640 train, 640 test\n",
|
989 |
-
"Using 2 dataloader workers\n",
|
990 |
-
"Logging results to runs/train/exp\n",
|
991 |
-
"Starting training for 1 epochs...\n",
|
992 |
-
"\n",
|
993 |
-
" Epoch gpu_mem box obj cls total labels img_size\n",
|
994 |
-
" 0/0 10.8G 0.04226 0.06068 0.02005 0.123 158 640: 100% 8/8 [00:05<00:00, 1.35it/s]\n",
|
995 |
-
" Class Images Labels P R [email protected] [email protected]:.95: 100% 4/4 [00:06<00:00, 1.53s/it]\n",
|
996 |
-
" all 128 929 0.633 0.641 0.668 0.439\n",
|
997 |
-
"1 epochs completed in 0.005 hours.\n",
|
998 |
-
"\n",
|
999 |
-
"Optimizer stripped from runs/train/exp/weights/last.pt, 14.8MB\n",
|
1000 |
-
"Optimizer stripped from runs/train/exp/weights/best.pt, 14.8MB\n",
|
1001 |
-
"\u001b[34m\u001b[1mgithub: \u001b[0mup to date with https://github.com/ultralytics/yolov5 β
\n",
|
1002 |
-
"YOLOv5 π v5.0-157-gc6b51f4 torch 1.8.1+cu101 CUDA:0 (Tesla V100-SXM2-16GB, 16160.5MB)\n",
|
1003 |
"\n",
|
1004 |
"Namespace(adam=False, artifact_alias='latest', batch_size=16, bbox_interval=-1, bucket='', cache_images=True, cfg='', data='./data/coco128.yaml', device='', entity=None, epochs=3, evolve=False, exist_ok=False, global_rank=-1, hyp='data/hyp.scratch.yaml', image_weights=False, img_size=[640, 640], label_smoothing=0.0, linear_lr=False, local_rank=-1, multi_scale=False, name='exp', noautoanchor=False, nosave=False, notest=False, project='runs/train', quad=False, rect=False, resume=False, save_dir='runs/train/exp', save_period=-1, single_cls=False, sync_bn=False, total_batch_size=16, upload_dataset=False, weights='yolov5s.pt', workers=8, world_size=1)\n",
|
1005 |
"\u001b[34m\u001b[1mtensorboard: \u001b[0mStart with 'tensorboard --logdir runs/train', view at http://localhost:6006/\n",
|
1006 |
-
"2021-06-08
|
1007 |
"\u001b[34m\u001b[1mhyperparameters: \u001b[0mlr0=0.01, lrf=0.2, momentum=0.937, weight_decay=0.0005, warmup_epochs=3.0, warmup_momentum=0.8, warmup_bias_lr=0.1, box=0.05, cls=0.5, cls_pw=1.0, obj=1.0, obj_pw=1.0, iou_t=0.2, anchor_t=4.0, fl_gamma=0.0, hsv_h=0.015, hsv_s=0.7, hsv_v=0.4, degrees=0.0, translate=0.1, scale=0.5, shear=0.0, perspective=0.0, flipud=0.0, fliplr=0.5, mosaic=1.0, mixup=0.0\n",
|
1008 |
"\u001b[34m\u001b[1mwandb: \u001b[0mInstall Weights & Biases for YOLOv5 logging with 'pip install wandb' (recommended)\n",
|
1009 |
"\n",
|
@@ -1038,10 +968,10 @@
|
|
1038 |
"Transferred 362/362 items from yolov5s.pt\n",
|
1039 |
"Scaled weight_decay = 0.0005\n",
|
1040 |
"Optimizer groups: 62 .bias, 62 conv.weight, 59 other\n",
|
1041 |
-
"\u001b[34m\u001b[1mtrain: \u001b[0mScanning '../coco128/labels/train2017.cache' images and labels... 128 found, 0 missing, 2 empty, 0 corrupted: 100% 128/128 [00:00<00:00,
|
1042 |
-
"\u001b[34m\u001b[1mtrain: \u001b[0mCaching images (0.1GB): 100% 128/128 [00:00<00:00,
|
1043 |
-
"\u001b[34m\u001b[1mval: \u001b[0mScanning '../coco128/labels/train2017.cache' images and labels... 128 found, 0 missing, 2 empty, 0 corrupted: 100% 128/128 [00:00<00:00,
|
1044 |
-
"\u001b[34m\u001b[1mval: \u001b[0mCaching images (0.1GB): 100% 128/128 [00:01<00:00, 98.
|
1045 |
"Plotting labels... \n",
|
1046 |
"\n",
|
1047 |
"\u001b[34m\u001b[1mautoanchor: \u001b[0mAnalyzing anchors... anchors/target = 4.26, Best Possible Recall (BPR) = 0.9946\n",
|
@@ -1051,19 +981,19 @@
|
|
1051 |
"Starting training for 3 epochs...\n",
|
1052 |
"\n",
|
1053 |
" Epoch gpu_mem box obj cls total labels img_size\n",
|
1054 |
-
" 0/2 10.8G 0.04226 0.06067 0.02005 0.123 158 640: 100% 8/8 [00:05<00:00, 1.
|
1055 |
-
" Class Images Labels P R [email protected] [email protected]:.95: 100% 4/4 [00:04<00:00, 1.
|
1056 |
-
" all 128 929 0.633 0.641 0.668 0.
|
1057 |
"\n",
|
1058 |
" Epoch gpu_mem box obj cls total labels img_size\n",
|
1059 |
-
" 1/2
|
1060 |
-
" Class Images Labels P R [email protected] [email protected]:.95: 100% 4/4 [00:01<00:00, 3.
|
1061 |
-
" all 128 929 0.
|
1062 |
"\n",
|
1063 |
" Epoch gpu_mem box obj cls total labels img_size\n",
|
1064 |
-
" 2/2
|
1065 |
-
" Class Images Labels P R [email protected] [email protected]:.95: 100% 4/4 [00:02<00:00, 1.
|
1066 |
-
" all 128 929 0.636 0.652 0.67
|
1067 |
"3 epochs completed in 0.007 hours.\n",
|
1068 |
"\n",
|
1069 |
"Optimizer stripped from runs/train/exp/weights/last.pt, 14.8MB\n",
|
|
|
917 |
"colab": {
|
918 |
"base_uri": "https://localhost:8080/"
|
919 |
},
|
920 |
+
"outputId": "c4dfc591-b6f9-4a60-9149-ee7eff970c90"
|
921 |
},
|
922 |
"source": [
|
923 |
"# Train YOLOv5s on COCO128 for 3 epochs\n",
|
924 |
"!python train.py --img 640 --batch 16 --epochs 3 --data coco128.yaml --weights yolov5s.pt --cache"
|
925 |
],
|
926 |
+
"execution_count": 9,
|
927 |
"outputs": [
|
928 |
{
|
929 |
"output_type": "stream",
|
930 |
"text": [
|
931 |
"\u001b[34m\u001b[1mgithub: \u001b[0mup to date with https://github.com/ultralytics/yolov5 β
\n",
|
932 |
+
"YOLOv5 π v5.0-158-g78cf488 torch 1.8.1+cu101 CUDA:0 (Tesla V100-SXM2-16GB, 16160.5MB)\n",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
933 |
"\n",
|
934 |
"Namespace(adam=False, artifact_alias='latest', batch_size=16, bbox_interval=-1, bucket='', cache_images=True, cfg='', data='./data/coco128.yaml', device='', entity=None, epochs=3, evolve=False, exist_ok=False, global_rank=-1, hyp='data/hyp.scratch.yaml', image_weights=False, img_size=[640, 640], label_smoothing=0.0, linear_lr=False, local_rank=-1, multi_scale=False, name='exp', noautoanchor=False, nosave=False, notest=False, project='runs/train', quad=False, rect=False, resume=False, save_dir='runs/train/exp', save_period=-1, single_cls=False, sync_bn=False, total_batch_size=16, upload_dataset=False, weights='yolov5s.pt', workers=8, world_size=1)\n",
|
935 |
"\u001b[34m\u001b[1mtensorboard: \u001b[0mStart with 'tensorboard --logdir runs/train', view at http://localhost:6006/\n",
|
936 |
+
"2021-06-08 17:00:55.016221: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Successfully opened dynamic library libcudart.so.11.0\n",
|
937 |
"\u001b[34m\u001b[1mhyperparameters: \u001b[0mlr0=0.01, lrf=0.2, momentum=0.937, weight_decay=0.0005, warmup_epochs=3.0, warmup_momentum=0.8, warmup_bias_lr=0.1, box=0.05, cls=0.5, cls_pw=1.0, obj=1.0, obj_pw=1.0, iou_t=0.2, anchor_t=4.0, fl_gamma=0.0, hsv_h=0.015, hsv_s=0.7, hsv_v=0.4, degrees=0.0, translate=0.1, scale=0.5, shear=0.0, perspective=0.0, flipud=0.0, fliplr=0.5, mosaic=1.0, mixup=0.0\n",
|
938 |
"\u001b[34m\u001b[1mwandb: \u001b[0mInstall Weights & Biases for YOLOv5 logging with 'pip install wandb' (recommended)\n",
|
939 |
"\n",
|
|
|
968 |
"Transferred 362/362 items from yolov5s.pt\n",
|
969 |
"Scaled weight_decay = 0.0005\n",
|
970 |
"Optimizer groups: 62 .bias, 62 conv.weight, 59 other\n",
|
971 |
+
"\u001b[34m\u001b[1mtrain: \u001b[0mScanning '../coco128/labels/train2017.cache' images and labels... 128 found, 0 missing, 2 empty, 0 corrupted: 100% 128/128 [00:00<00:00, 1503840.09it/s]\n",
|
972 |
+
"\u001b[34m\u001b[1mtrain: \u001b[0mCaching images (0.1GB): 100% 128/128 [00:00<00:00, 198.74it/s]\n",
|
973 |
+
"\u001b[34m\u001b[1mval: \u001b[0mScanning '../coco128/labels/train2017.cache' images and labels... 128 found, 0 missing, 2 empty, 0 corrupted: 100% 128/128 [00:00<00:00, 475107.00it/s]\n",
|
974 |
+
"\u001b[34m\u001b[1mval: \u001b[0mCaching images (0.1GB): 100% 128/128 [00:01<00:00, 98.63it/s]\n",
|
975 |
"Plotting labels... \n",
|
976 |
"\n",
|
977 |
"\u001b[34m\u001b[1mautoanchor: \u001b[0mAnalyzing anchors... anchors/target = 4.26, Best Possible Recall (BPR) = 0.9946\n",
|
|
|
981 |
"Starting training for 3 epochs...\n",
|
982 |
"\n",
|
983 |
" Epoch gpu_mem box obj cls total labels img_size\n",
|
984 |
+
" 0/2 10.8G 0.04226 0.06067 0.02005 0.123 158 640: 100% 8/8 [00:05<00:00, 1.45it/s]\n",
|
985 |
+
" Class Images Labels P R [email protected] [email protected]:.95: 100% 4/4 [00:04<00:00, 1.17s/it]\n",
|
986 |
+
" all 128 929 0.633 0.641 0.668 0.438\n",
|
987 |
"\n",
|
988 |
" Epoch gpu_mem box obj cls total labels img_size\n",
|
989 |
+
" 1/2 6.66G 0.04571 0.06615 0.01952 0.1314 164 640: 100% 8/8 [00:01<00:00, 5.10it/s]\n",
|
990 |
+
" Class Images Labels P R [email protected] [email protected]:.95: 100% 4/4 [00:01<00:00, 3.88it/s]\n",
|
991 |
+
" all 128 929 0.614 0.661 0.67 0.438\n",
|
992 |
"\n",
|
993 |
" Epoch gpu_mem box obj cls total labels img_size\n",
|
994 |
+
" 2/2 6.66G 0.04542 0.07179 0.01861 0.1358 191 640: 100% 8/8 [00:01<00:00, 5.40it/s]\n",
|
995 |
+
" Class Images Labels P R [email protected] [email protected]:.95: 100% 4/4 [00:02<00:00, 1.43it/s]\n",
|
996 |
+
" all 128 929 0.636 0.652 0.67 0.439\n",
|
997 |
"3 epochs completed in 0.007 hours.\n",
|
998 |
"\n",
|
999 |
"Optimizer stripped from runs/train/exp/weights/last.pt, 14.8MB\n",
|