Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

#875 Feature/sg 761 yolo nas

Merged
Ghost merged 1 commits into Deci-AI:master from deci-ai:feature/SG-761-yolo-nas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
  1. # SegFormer segmentation training example with Cityscapes dataset.
  2. # Reproduction of paper:
  3. # Enze Xie, Wenhai Wang, Zhiding Yu, Anima Anandkumar, Jose M. Alvarez, Ping Luo
  4. # "SegFormer: Simple and Efficient Design for Semantic Segmentation with Transformers"
  5. # ( https://arxiv.org/pdf/2105.15203.pdf )
  6. #
  7. # Official git repo:
  8. # https://github.com/NVlabs/SegFormer
  9. #
  10. # Code and Imagenet-1k pre-trained backbone weights taken and adapted from:
  11. # https://github.com/sithu31296/semantic-segmentation
  12. #
  13. # Instructions:
  14. # 1. Choose SegFormer architecture (b0 - b5) by changing the value of the "architecture" field below
  15. # 2. We recommend preparing the data according to SG's CityScapes readme file:
  16. # https://github.com/Deci-AI/super-gradients/blob/master/src/super_gradients/training/datasets/Dataset_Setup_Instructions.md
  17. # 3. Note: if you change the dataset's internal directory structure, make changes to the fields "list_file" and
  18. # "labels_csv_path" of both "train_dataset_params" and "val_dataset_params" accordingly
  19. # 4. Edit the "data_root_dir" field below to point to the absolute path of the data root directory
  20. # 5. Edit the "ckpt_root_dir" field to the path where you want to save checkpoints and logs
  21. # 6. Move to the project root (where you will find the ReadMe and src folder)
  22. # 7. Run the command (change:
  23. # python -m super_gradients.train_from_recipe --config-name=cityscapes_segformer
  24. #
  25. #
  26. # Imagenet-1K pre-trained backbone:
  27. # MiT (Mix Transformer) B0: https://deci-pretrained-models.s3.amazonaws.com/mit_backbones/mit_b0.pth
  28. # B1: https://deci-pretrained-models.s3.amazonaws.com/mit_backbones/mit_b1.pth
  29. # B2: https://deci-pretrained-models.s3.amazonaws.com/mit_backbones/mit_b2.pth
  30. # B3: https://deci-pretrained-models.s3.amazonaws.com/mit_backbones/mit_b3.pth
  31. # B4: https://deci-pretrained-models.s3.amazonaws.com/mit_backbones/mit_b4.pth
  32. # B5: https://deci-pretrained-models.s3.amazonaws.com/mit_backbones/mit_b5.pth
  33. #
  34. # 1. Download the weights from the above link and put them in a directory of your choice
  35. # 2. Below, insert the weights file's full path to checkpoint_params.checkpoint_path
  36. # 3. Ensure checkpoint_params.load_backbone: True
  37. #
  38. # Performance and training details:
  39. # SegFormer-B0: mIoU (sliding-window inference) on validation set: 76.25
  40. # training time: 17 hours with 3 A10G GPUs with DDP, ~3 minuets / epoch
  41. defaults:
  42. - training_hyperparams: default_train_params
  43. - dataset_params: cityscapes_segformer_dataset_params
  44. - checkpoint_params: default_checkpoint_params
  45. - _self_
  46. - variable_setup
  47. architecture: segformer_b0 # segformer_b1, segformer_b2, segformer_b3, segformer_b4, segformer_b5
  48. data_root_dir: /data/cityscapes
  49. dataset_params:
  50. train_dataset_params:
  51. root_dir: ${data_root_dir}
  52. val_dataset_params:
  53. root_dir: ${data_root_dir}
  54. experiment_name: ${architecture}_cityscapes
  55. train_dataloader: cityscapes_train
  56. val_dataloader: cityscapes_val
  57. cityscapes_ignored_label: 19 # convenience parameter since it is used in many places in the YAML
  58. arch_params:
  59. num_classes: 19
  60. checkpoint_params:
  61. checkpoint_path:
  62. load_backbone: True
  63. load_weights_only: True
  64. strict_load: no_key_matching
  65. load_checkpoint: False
  66. resume: False
  67. training_hyperparams:
  68. resume: ${resume}
  69. max_epochs: 400
  70. lr_mode: poly
  71. initial_lr: 0.0002 # for effective batch_size=8
  72. optimizer: AdamW
  73. zero_weight_decay_on_bias_and_bn: True
  74. sync_bn: True
  75. loss: cross_entropy
  76. criterion_params:
  77. ignore_index: ${cityscapes_ignored_label}
  78. train_metrics_list:
  79. - IoU:
  80. num_classes: 20
  81. ignore_index: ${cityscapes_ignored_label}
  82. valid_metrics_list:
  83. - IoU:
  84. num_classes: 20
  85. ignore_index: ${cityscapes_ignored_label}
  86. metric_to_watch: IoU
  87. greater_metric_to_watch_is_better: True
  88. multi_gpu: DDP
  89. num_gpus: 4
Discard
Tip!

Press p or to see the previous file or, n or to see the next file