From 45bb1ddce99b71f8853a07ad0d331c57c76a7a3c Mon Sep 17 00:00:00 2001 From: wsq3 <877518222@qq.com> Date: Fri, 16 Oct 2020 15:19:52 +0800 Subject: [PATCH] modified the interface of ParallelMode --- model_zoo/official/recommend/deepfm/src/deepfm.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/model_zoo/official/recommend/deepfm/src/deepfm.py b/model_zoo/official/recommend/deepfm/src/deepfm.py index 50c60e79692..bf799ad6be6 100644 --- a/model_zoo/official/recommend/deepfm/src/deepfm.py +++ b/model_zoo/official/recommend/deepfm/src/deepfm.py @@ -29,7 +29,7 @@ from mindspore import nn, Tensor, ParameterTuple, Parameter from mindspore.common.initializer import Uniform, initializer from mindspore.train.callback import ModelCheckpoint, CheckpointConfig from mindspore.parallel._utils import _get_device_num, _get_parallel_mode, _get_gradients_mean -from mindspore.train.parallel_utils import ParallelMode +from mindspore.context import ParallelMode from mindspore.nn.wrap.grad_reducer import DistributedGradReducer from src.callback import EvalCallBack, LossCallBack @@ -270,7 +270,7 @@ class TrainStepWrap(nn.Cell): self.weights = ParameterTuple(network.trainable_params()) self.optimizer = Adam(self.weights, learning_rate=lr, eps=eps, loss_scale=loss_scale) self.hyper_map = C.HyperMap() - self.grad = C.GradOperation('grad', get_by_list=True, sens_param=True) + self.grad = C.GradOperation(get_by_list=True, sens_param=True) self.sens = loss_scale self.reducer_flag = False