提交 91e2bc8a 编写于 作者: H Hongyu Li 提交者: pkpk

Check paddle version before using cuda (#2685)

上级 0d1ec6da
......@@ -640,6 +640,12 @@ if __name__ == '__main__':
logger.addHandler(console_handler)
args = parse_args()
logger.info('Running with args : {}'.format(args))
try:
if fluid.is_compiled_with_cuda() != True and args.use_cuda == True:
print("\nYou can not set use_cuda = True in the model because you are using paddlepaddle-cpu.\nPlease: 1. Install paddlepaddle-gpu to run your models on GPU or 2. Set use_cuda = False to run models on CPU.\n")
sys.exit(1)
except Exception as e:
pass
if args.prepare:
prepare(logger, args)
if args.train:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册