更新 'pretrain_for_c2net.py'

增加异常捕获
This commit is contained in:
liuzx 2022-12-06 10:23:07 +08:00
parent b91fd673a6
commit dc6f73fd40
1 changed files with 7 additions and 4 deletions

View File

@ -191,10 +191,13 @@ if __name__ == "__main__":
data_dir = '/cache/data'
train_dir = '/cache/output'
ckpt_url = '/cache/checkpoint.ckpt'
if not os.path.exists(data_dir):
os.makedirs(data_dir)
if not os.path.exists(train_dir):
os.makedirs(train_dir)
try:
if not os.path.exists(data_dir):
os.makedirs(data_dir)
if not os.path.exists(train_dir):
os.makedirs(train_dir)
except Exception as e:
print("path already exists")
###Copy ckpt file from obs to training image
ObsUrlToEnv(args.ckpt_url, ckpt_url)
###Initialize and copy data to training image