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.

train.json 3.3 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. {
  2. "framework": "pytorch",
  3. "task": "image_classification",
  4. "model": {
  5. "type": "Resnet50ForImageClassification",
  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. },
  46. "preprocessor":{
  47. "train": [
  48. {
  49. "type": "RandomResizedCrop",
  50. "size": 224
  51. },
  52. {
  53. "type": "RandomHorizontalFlip"
  54. },
  55. {
  56. "type": "ToTensor"
  57. },
  58. {
  59. "type": "Normalize",
  60. "mean": [
  61. 0.485,
  62. 0.456,
  63. 0.406
  64. ],
  65. "std": [
  66. 0.229,
  67. 0.224,
  68. 0.225
  69. ]
  70. },
  71. {
  72. "type": "Collect",
  73. "keys": [
  74. "img",
  75. "gt_labels"
  76. ]
  77. }
  78. ],
  79. "val": [
  80. {
  81. "type": "Resize",
  82. "size": 256
  83. },
  84. {
  85. "type": "CenterCrop",
  86. "size": 224
  87. },
  88. {
  89. "type": "ToTensor"
  90. },
  91. {
  92. "type": "Normalize",
  93. "mean": [
  94. 0.485,
  95. 0.456,
  96. 0.406
  97. ],
  98. "std": [
  99. 0.229,
  100. 0.224,
  101. 0.225
  102. ]
  103. },
  104. {
  105. "type": "Collect",
  106. "keys": [
  107. "img",
  108. "gt_labels"
  109. ]
  110. }
  111. ]
  112. },
  113. "train": {
  114. "batch_size": 32,
  115. "learning_rate": 0.00001,
  116. "lr_scheduler_type": "cosine",
  117. "num_epochs": 20
  118. },
  119. "evaluation": {
  120. "batch_size": 32,
  121. "metrics": ["accuracy", "precision", "recall"]
  122. }
  123. }