Files
modelscope/configs/examples/train.json

132 lines
3.2 KiB
JSON
Raw Permalink Normal View History

{
"framework": "pytorch",
"task": "image_classification",
"model": {
"type": "Resnet50ForImageClassification",
"pretrained": null,
"backbone": {
"type": "ResNet",
"depth": 50,
"out_indices": [
4
],
"norm_cfg": {
"type": "BN"
}
},
"head": {
"type": "ClsHead",
"with_avg_pool": true,
"in_channels": 2048,
"loss_config": {
"type": "CrossEntropyLossWithLabelSmooth",
"label_smooth": 0
},
"num_classes": 1000
}
},
"dataset": {
"train": {
"type": "ClsDataset",
"data_source": {
"list_file": "data/imagenet_raw/meta/train_labeled.txt",
"root": "data/imagenet_raw/train/",
"type": "ClsSourceImageList"
}
},
"val": {
"type": "ClsDataset",
"data_source": {
"list_file": "data/imagenet_raw/meta/val_labeled.txt",
"root": "data/imagenet_raw/validation/",
"type": "ClsSourceImageList"
}
}
},
"preprocessor":{
"train": [
{
"type": "RandomResizedCrop",
"size": 224
},
{
"type": "RandomHorizontalFlip"
},
{
"type": "ToTensor"
},
{
"type": "Normalize",
"mean": [
0.485,
0.456,
0.406
],
"std": [
0.229,
0.224,
0.225
]
},
{
"type": "Collect",
"keys": [
"img",
"gt_labels"
]
}
],
"val": [
{
"type": "Resize",
"size": 256
},
{
"type": "CenterCrop",
"size": 224
},
{
"type": "ToTensor"
},
{
"type": "Normalize",
"mean": [
0.485,
0.456,
0.406
],
"std": [
0.229,
0.224,
0.225
]
},
{
"type": "Collect",
"keys": [
"img",
"gt_labels"
]
}
]
},
"train": {
"batch_size": 32,
"learning_rate": 0.00001,
"lr_scheduler_type": "cosine",
"num_epochs": 20
},
"evaluation": {
"batch_size": 32,
"metrics": ["accuracy", "precision", "recall"]
}
}