forked from mindspore-Ecosystem/mindspore
model_train
This commit is contained in:
parent
521e351dac
commit
65a9c80aae
|
@ -378,8 +378,8 @@ class Model:
|
|||
with _CallbackManager(callbacks) as list_callback:
|
||||
if not dataset_sink_mode:
|
||||
self._train_process(epoch, train_dataset, list_callback, cb_params)
|
||||
elif context.get_context("mode") == context.PYNATIVE_MODE:
|
||||
logger.warning("The pynative mode cannot support dataset sink mode currently."
|
||||
elif context.get_context("mode") == context.PYNATIVE_MODE or context.get_context("device_target") == "CPU":
|
||||
logger.warning("The pynative mode and CPU cannot support dataset sink mode currently."
|
||||
"So the training process will be performed with dataset not sink.")
|
||||
self._train_process(epoch, train_dataset, list_callback, cb_params)
|
||||
else:
|
||||
|
|
|
@ -44,8 +44,6 @@ if __name__ == "__main__":
|
|||
|
||||
args = parser.parse_args()
|
||||
|
||||
if args.device_target == "CPU":
|
||||
args.dataset_sink_mode = False
|
||||
|
||||
context.set_context(mode=context.GRAPH_MODE, device_target=args.device_target)
|
||||
ds_train = create_dataset(os.path.join(args.data_path, "train"),
|
||||
|
|
Loading…
Reference in New Issue