Skip to content

Commit 352a76f

Browse files
committed
Refactor: Add default configs
1 parent d50e2d5 commit 352a76f

File tree

4 files changed

+12
-18
lines changed

4 files changed

+12
-18
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ Download the trained model from [**_here_**](https://drive.google.com/drive/fold
9999
then put it to `${ROOT}/checkpoints/` and execute:
100100

101101
```shell script
102-
python test.py --gpu_idx 0 --pretrained_path ../checkpoints/complex_yolov4/complex_yolov4_mse_loss.pth --cfgfile ./config/cfg/complex_yolov4.cfg
102+
python test.py --gpu_idx 0 --pretrained_path ../checkpoints/complex_yolov4/complex_yolov4_mse_loss.pth --cfgfile ./config/cfg/complex_yolov4.cfg --show_image
103103
```
104104

105105
#### 2.4.3. Evaluation

src/config/train_config.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,18 +61,18 @@ def parse_train_configs():
6161
help='If true, dont evaluate the model on the val set')
6262
parser.add_argument('--num_samples', type=int, default=None,
6363
help='Take a subset of the dataset to run and debug')
64-
parser.add_argument('--num_workers', type=int, default=8,
64+
parser.add_argument('--num_workers', type=int, default=4,
6565
help='Number of threads for loading data')
6666
parser.add_argument('--batch_size', type=int, default=4,
6767
help='mini-batch size (default: 4), this is the total'
6868
'batch size of all GPUs on the current node when using'
6969
'Data Parallel or Distributed Data Parallel')
7070
parser.add_argument('--print_freq', type=int, default=50, metavar='N',
7171
help='print frequency (default: 50)')
72-
parser.add_argument('--tensorboard_freq', type=int, default=20, metavar='N',
73-
help='frequency of saving tensorboard (default: 20)')
74-
parser.add_argument('--checkpoint_freq', type=int, default=2, metavar='N',
75-
help='frequency of saving checkpoints (default: 2)')
72+
parser.add_argument('--tensorboard_freq', type=int, default=50, metavar='N',
73+
help='frequency of saving tensorboard (default: 50)')
74+
parser.add_argument('--checkpoint_freq', type=int, default=5, metavar='N',
75+
help='frequency of saving checkpoints (default: 5)')
7676
####################################################################
7777
############## Training strategy ####################
7878
####################################################################
@@ -83,14 +83,14 @@ def parse_train_configs():
8383
help='number of total epochs to run')
8484
parser.add_argument('--lr_type', type=str, default='cosin',
8585
help='the type of learning rate scheduler (cosin or multi_step)')
86-
parser.add_argument('--lr', type=float, default=0.0025, metavar='LR',
86+
parser.add_argument('--lr', type=float, default=0.001, metavar='LR',
8787
help='initial learning rate')
8888
parser.add_argument('--minimum_lr', type=float, default=1e-7, metavar='MIN_LR',
8989
help='minimum learning rate during training')
9090
parser.add_argument('--momentum', type=float, default=0.949, metavar='M',
9191
help='momentum')
9292
parser.add_argument('-wd', '--weight_decay', type=float, default=5e-4, metavar='WD',
93-
help='weight decay (default: 1e-6)')
93+
help='weight decay (default: 5e-4)')
9494
parser.add_argument('--optimizer_type', type=str, default='adam', metavar='OPTIMIZER',
9595
help='the type of optimizer, it can be sgd or adam')
9696
parser.add_argument('--burn_in', type=int, default=50, metavar='N',

src/test.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ python test.py \
66
--batch_size 1 \
77
--num_workers 1 \
88
--gpu_idx 0 \
9-
--pretrained_path ../checkpoints/complex_yolov4/Model_complex_yolov4_epoch_200.pth \
9+
--pretrained_path ../checkpoints/complex_yolov4/Model_complex_yolov4_epoch_300.pth \
1010
--img_size 608 \
11-
--conf_thresh 0.9 \
12-
--nms_thresh 0.1 \
11+
--conf_thresh 0.5 \
12+
--nms_thresh 0.5 \
1313
--show_image \
1414
--save_test_output \
1515
--output_format 'image'

src/train.sh

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,4 @@ python train.py \
66
--batch_size 4 \
77
--num_workers 4 \
88
--no-val \
9-
--gpu_idx 0 \
10-
--lr_type 'cosin' \
11-
--lr 0.001 \
12-
--num_epochs 300 \
13-
--tensorboard_freq 50 \
14-
--checkpoint_freq 5 \
15-
--multiscale_training
9+
--gpu_idx 0

0 commit comments

Comments
 (0)