You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

configuration.json 4.4 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. {
  2. "framework": "pytorch",
  3. "task": "image_classification",
  4. "model": {
  5. "type": "classification",
  6. "pretrained": null,
  7. "backbone": {
  8. "type": "ResNet",
  9. "depth": 50,
  10. "out_indices": [
  11. 4
  12. ],
  13. "norm_cfg": {
  14. "type": "BN"
  15. }
  16. },
  17. "head": {
  18. "type": "ClsHead",
  19. "with_avg_pool": true,
  20. "in_channels": 2048,
  21. "loss_config": {
  22. "type": "CrossEntropyLossWithLabelSmooth",
  23. "label_smooth": 0
  24. },
  25. "num_classes": 1000
  26. }
  27. },
  28. "dataset": {
  29. "train": {
  30. "type": "ClsDataset",
  31. "data_source": {
  32. "list_file": "data/imagenet_raw/meta/train_labeled.txt",
  33. "root": "data/imagenet_raw/train/",
  34. "type": "ClsSourceImageList"
  35. }
  36. },
  37. "val": {
  38. "type": "ClsDataset",
  39. "data_source": {
  40. "list_file": "data/imagenet_raw/meta/val_labeled.txt",
  41. "root": "data/imagenet_raw/validation/",
  42. "type": "ClsSourceImageList"
  43. }
  44. },
  45. "test": {}
  46. },
  47. "preprocessor":{
  48. "train": [
  49. {
  50. "type": "RandomResizedCrop",
  51. "size": 224
  52. },
  53. {
  54. "type": "RandomHorizontalFlip"
  55. },
  56. {
  57. "type": "ToTensor"
  58. },
  59. {
  60. "type": "Normalize",
  61. "mean": [
  62. 0.485,
  63. 0.456,
  64. 0.406
  65. ],
  66. "std": [
  67. 0.229,
  68. 0.224,
  69. 0.225
  70. ]
  71. },
  72. {
  73. "type": "Collect",
  74. "keys": [
  75. "img",
  76. "gt_labels"
  77. ]
  78. }
  79. ],
  80. "val": [
  81. {
  82. "type": "Resize",
  83. "size": 256
  84. },
  85. {
  86. "type": "CenterCrop",
  87. "size": 224
  88. },
  89. {
  90. "type": "ToTensor"
  91. },
  92. {
  93. "type": "Normalize",
  94. "mean": [
  95. 0.485,
  96. 0.456,
  97. 0.406
  98. ],
  99. "std": [
  100. 0.229,
  101. 0.224,
  102. 0.225
  103. ]
  104. },
  105. {
  106. "type": "Collect",
  107. "keys": [
  108. "img",
  109. "gt_labels"
  110. ]
  111. }
  112. ]
  113. },
  114. "train": {
  115. "work_dir": "./work_dir",
  116. "dataloader": {
  117. "batch_size_per_gpu": 2,
  118. "workers_per_gpu": 1
  119. },
  120. "optimizer": {
  121. "type": "SGD",
  122. "lr": 0.01,
  123. "options": {
  124. "grad_clip": {
  125. "max_norm": 2.0
  126. }
  127. }
  128. },
  129. "lr_scheduler": {
  130. "type": "StepLR",
  131. "step_size": 2,
  132. "options": {
  133. "warmup": {
  134. "type": "LinearWarmup",
  135. "warmup_iters": 2
  136. }
  137. }
  138. },
  139. "hooks":
  140. [
  141. {
  142. "type": "CheckpointHook",
  143. "interval": 2
  144. },
  145. {
  146. "type": "TextLoggerHook",
  147. "interval": 1
  148. },
  149. {
  150. "type": "IterTimerHook"
  151. },
  152. {
  153. "type": "EvaluationHook",
  154. "interval": 1
  155. }
  156. ]
  157. },
  158. "evaluation": {
  159. "dataloader": {
  160. "batch_size_per_gpu": 2,
  161. "workers_per_gpu": 1,
  162. "shuffle": false
  163. },
  164. "metrics": ["accuracy", "precision", "recall"]
  165. },
  166. "pipeline": {
  167. "type": "dummy"
  168. }
  169. }