提交 32fce19a 编写于 作者: W wuzewu

Fix devices issue

上级 c364c05b
...@@ -102,7 +102,7 @@ def evaluate(cfg, ckpt_dir=None, use_gpu=False, use_mpio=False, **kwargs): ...@@ -102,7 +102,7 @@ def evaluate(cfg, ckpt_dir=None, use_gpu=False, use_mpio=False, **kwargs):
places = fluid.cuda_places() if use_gpu else fluid.cpu_places() places = fluid.cuda_places() if use_gpu else fluid.cpu_places()
place = places[0] place = places[0]
dev_count = len(places) dev_count = len(places)
print("Device count = {}".format(dev_count)) print("#Device count: {}".format(dev_count))
exe = fluid.Executor(place) exe = fluid.Executor(place)
exe.run(startup_prog) exe.run(startup_prog)
......
...@@ -216,7 +216,7 @@ def train(cfg): ...@@ -216,7 +216,7 @@ def train(cfg):
place = places[0] place = places[0]
# Get number of GPU # Get number of GPU
dev_count = len(places) dev_count = len(places)
print("#GPU-Devices: {}".format(dev_count)) print("#Device count: {}".format(dev_count))
# Make sure BATCH_SIZE can divided by GPU cards # Make sure BATCH_SIZE can divided by GPU cards
assert cfg.BATCH_SIZE % dev_count == 0, ( assert cfg.BATCH_SIZE % dev_count == 0, (
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册