|
- # Copyright 2020 Huawei Technologies Co., Ltd
- #
- # Licensed under the Apache License, Version 2.0 (the "License");
- # you may not use this file except in compliance with the License.
- # You may obtain a copy of the License at
- #
- # http://www.apache.org/licenses/LICENSE-2.0
- #
- # Unless required by applicable law or agreed to in writing, software
- # distributed under the License is distributed on an "AS IS" BASIS,
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- # See the License for the specific language governing permissions and
- # limitations under the License.
- # ============================================================================
- """
- network config setting, will be used in train.py
- """
-
- from easydict import EasyDict as edict
-
- config = edict({
-
- # Train params
- "lr": 0.0001,
- "lr_backbone": 0.00001,
- "lr_drop": 200,
- "weight_decay": 0.0001,
- "clip_max_norm": 0.1,
- "batch_size": 4,
- "start_epoch": 300,
- "epochs": 500,
- "save_num_ckpt": 10,
- "seed": 42,
- "pretrained": True,
-
- # Context
- "device_id": 0,
- "device_target": "Ascend",
- "context_mode": "pynative",
- "coco_path": "/cache/data/annotations_trainval2017",
- "output_dir": "/cache/output/",
- "clip_max_norm": 0.1,
- "dropout": 0.1,
-
- # Loss
- "aux_loss": True,
-
- # Dataset parameters
- "num_classes": 91,
- "output_dir": '',
- "num_parallel_workers": 8,
- "python_multiprocessing": False,
- "max_size": 960,
- "flip_ratio": 0.5,
- "train_data_type": "train2017",
- "val_data_type": "val2017",
-
- # Backbone
- "backbone": "resnet50",
- "replace_strides_with_dilation": [False, False, False],
-
- # Transformer
- "enc_layers": 6,
- "dec_layers": 6,
- "dim_feedforward": 2048,
- "hidden_dim": 256,
- "dropout": 0.1,
- "nheads": 8,
- "num_queries": 100,
- "pre_norm": False,
-
- # Matcher
- "set_cost_class": 1,
- "set_cost_bbox": 5,
- "set_cost_giou": 2,
-
- # Loss coefficients
- "dice_loss_coef": 1,
- "bbox_loss_coef": 5,
- "giou_loss_coef": 2,
- "eos_coef": 0.1,
-
- # Distributed switch
- "distributed": 1
-
- })
|