TypeError Traceback (most recent call last)
/tmp/ipykernel_712/315126159.py in
19
20 args_opt = parser.parse_args()
—> 21 run_eval(args_opt)
/tmp/ipykernel_712/1992224717.py in run_eval(args)
4
5 if args.model == ‘13B_fp16’:
----> 6 model_predict = get_model_13b_fp16(args)
7 if args.model == ‘2B6_fp16’:
8 model_predict = get_model_2b6_fp16(args)
/tmp/ipykernel_712/1549244104.py in get_model_13b_fp16(args)
24 eod_reset=False)
25 print("===config is: ", config, flush=True)
—> 26 pangu_ = PANGUALPHA_fp16(config)
27 # pangu_ = VirtualDatasetOneInputCell(pangu_)
28 eval_pangu = EvalNet_p(pangu_, generate=True)
/code/PanGu-Alpha-GPU/inference_mindspore_gpu/pangu_dropout_recompute_eos_fp16.py in init(self, config)
751 def init(self, config):
752 super(PANGUALPHA, self).init()
–> 753 self.backbone = PANGUALPHA_Model(config)
754 self.head = PANGUALPHA_Head(config)
755
/code/PanGu-Alpha-GPU/inference_mindspore_gpu/pangu_dropout_recompute_eos_fp16.py in init(self, config)
621 per_block = Block(config, i + 1).set_comm_fusion(int(i / fusion_group_size) + 2)
622 if config.use_recompute:
–> 623 per_block.recompute()
624 # per_block.attention.dropout.dropout_gen_mask.recompute(False)
625 # per_block.attention.prob_dropout.dropout_gen_mask.recompute(False)
/usr/local/python-3.7.5/lib/python3.7/site-packages/mindspore/nn/cell.py in recompute(self, mode, output_recompute)
1306 “”"
1307 if context.get_context(“mode”) == context.PYNATIVE_MODE:
-> 1308 raise TypeError(“Recompute is not supported in pynative mode currently.”)
1309 Validator.check_bool(mode)
1310 Validator.check_bool(output_recompute)
TypeError: Recompute is not supported in pynative mode currently.
解决:
import mindspore
from mindspore import context
context.set_context(mode=context.GRAPH_MODE)