|
|
@@ -44,6 +44,7 @@ set_seed(42) |
|
|
|
def set_default(): |
|
|
|
""" set default """ |
|
|
|
print('***********************data_url**************************', config.data_url, flush=True) |
|
|
|
|
|
|
|
if config.enable_modelarts: |
|
|
|
config.data_root = os.path.join(config.data_url, 'coco2017/train2017') |
|
|
|
print('in default:', |
|
|
@@ -279,6 +280,18 @@ def run_train(): |
|
|
|
if config.resume_yolox: |
|
|
|
load_resume_params(config, network_ema) |
|
|
|
if not config.data_aug: |
|
|
|
# for the last no data aug ckpt preprocess |
|
|
|
if config.enable_modelarts: |
|
|
|
url = config.yolox_no_aug_ckpt |
|
|
|
from urllib import request |
|
|
|
import zipfile |
|
|
|
print("downloading the ckpt file...") |
|
|
|
request.urlretrieve(url, './285.zip') |
|
|
|
zf = zipfile.ZipFile('./285.zip') |
|
|
|
zf.extractall(path='./') |
|
|
|
zf.close() |
|
|
|
print('ckpt download done') |
|
|
|
config.yolox_no_aug_ckpt = './285.ckpt' |
|
|
|
if os.path.isfile(config.yolox_no_aug_ckpt): # Loading the resume checkpoint for the last no data aug epochs |
|
|
|
param_dict = load_checkpoint(config.yolox_no_aug_ckpt) |
|
|
|
if "learning_rate" in param_dict: |
|
|
@@ -305,6 +318,7 @@ def run_train(): |
|
|
|
is_modelart=config.enable_modelarts, |
|
|
|
per_print_times=config.log_interval, train_url=args_opt.train_url)) |
|
|
|
if config.run_eval: |
|
|
|
config.logger.info('save_ckpt_path:', save_ckpt_path) |
|
|
|
cb.append( |
|
|
|
EvalCallBack(ds_test, test_network, network_ema, DetectionEngine(config), config, save_path=save_ckpt_path)) |
|
|
|
if config.need_profiler: |
|
|
|