- logging 捕获异常
try:
main(CtrFgConf, p.local, p.debug, **Params)
except Exception as e:
logging.error(f'{e}:当前TF版本不是paitf? 提交命令中加参数--nopaitf试试?', exc_info=True)
- 直接打印捕获异常
try:
main(CtrFgConf, p.local, p.debug, **Params)
except Exception as e:
traceback.print_exception(
etype=type(e), tb=e.__traceback__,
value=type(e)(f'{e}\n当前TF版本不是paitf? 提交命令中加参数--nopaitf试试?'),)