机器阅读理解任务demo报错AttributeError: 'NoneType' object has no attribute 'nranks'
Created by: leo038
执行脚本: python3 ./ERNIE-develop/demo/finetune_mrc_dygraph.py --from_pretrained ./pretrain_model/ --train_file ./cmrc2018/train/train.json --dev_file ./cmrc2018/dev/dev.json
报错信息: Traceback (most recent call last): File "./ERNIE-develop/demo/finetune_mrc_dygraph.py", line 169, in train(model, train_dataset, dev_dataset, dev_examples, dev_features, tokenizer, args) File "./ERNIE-develop/demo/finetune_mrc_dygraph.py", line 97, in train scaled_loss = model.scale_loss(loss) File "/home/xxx/.local/lib/python3.6/site-packages/paddle/fluid/dygraph/parallel.py", line 333, in scale_loss if not self._is_data_parallel_mode(): File "/home/xxx/.local/lib/python3.6/site-packages/paddle/fluid/dygraph/parallel.py", line 457, in _is_data_parallel_mode return self._strategy.nranks > 1 AttributeError: 'NoneType' object has no attribute 'nranks'