From 5b0fee04a85f5cdb34b43b3d3745889c03908a51 Mon Sep 17 00:00:00 2001 From: ZaneYork Date: Sun, 19 Dec 2021 19:09:27 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cuda_train.cmd | 2 +- douzero/dmc/arguments.py | 4 ++-- douzero/dmc/dmc.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cuda_train.cmd b/cuda_train.cmd index 2270905..7d471d5 100644 --- a/cuda_train.cmd +++ b/cuda_train.cmd @@ -1 +1 @@ -python train.py --load_model --batch_size 8 --learning_rate 0.0003 --enable_onnx \ No newline at end of file +python train.py --load_model --batch_size 4 --learning_rate 0.0003 --enable_onnx \ No newline at end of file diff --git a/douzero/dmc/arguments.py b/douzero/dmc/arguments.py index 496fe4c..68244c3 100644 --- a/douzero/dmc/arguments.py +++ b/douzero/dmc/arguments.py @@ -11,8 +11,8 @@ parser.add_argument('--objective', default='adp', type=str, choices=['adp', 'wp' help='Use ADP or WP as reward (default: ADP)') # Training settings -parser.add_argument('--onnx_sync_interval', default=5, type=int, - help='Time interval (in minutes) at which to sync the onnx model') +parser.add_argument('--onnx_sync_interval', default=30, type=int, + help='Time interval (in seconds) at which to sync the onnx model') parser.add_argument('--actor_device_cpu', action='store_true', help='Use CPU as actor device') parser.add_argument('--gpu_devices', default='0', type=str, diff --git a/douzero/dmc/dmc.py b/douzero/dmc/dmc.py index 53ff12e..242aecf 100644 --- a/douzero/dmc/dmc.py +++ b/douzero/dmc/dmc.py @@ -254,7 +254,7 @@ def train(flags): checkpoint(frames) last_checkpoint_time = timer() - if timer() - last_onnx_sync_time > flags.onnx_sync_interval * 60: + if timer() - last_onnx_sync_time > flags.onnx_sync_interval: sync_onnx_model(frames) last_onnx_sync_time = timer()