diff --git a/model_zoo/official/nlp/bert/run_ner.py b/model_zoo/official/nlp/bert/run_ner.py index 053e08edc49..45d2676c9fb 100644 --- a/model_zoo/official/nlp/bert/run_ner.py +++ b/model_zoo/official/nlp/bert/run_ner.py @@ -214,7 +214,7 @@ def run_ner(): if bert_net_cfg.compute_type != mstype.float32: logger.warning('GPU only support fp32 temporarily, run with fp32.') bert_net_cfg.compute_type = mstype.float32 - if optimizer_cfg.optimizer == 'AdamWeightDecay' and args_opt.use_crf.lower() == "false": + if optimizer_cfg.optimizer == 'AdamWeightDecay': context.set_context(enable_graph_kernel=True) else: raise Exception("Target error, GPU or Ascend is supported.")