【mindspore】【算子不支持GPU】Unsupported op [Ceil] on GPU

发布时间:2023-06-04 19:00

问题描述:

【功能模块】

在训练时报错,提示算子不支持gpu类型

【操作步骤&问题现象】

1、开始训练,加载数据,走到train时就报错

【截图信息】

[EXCEPTION] DEVICE(35811,7f3f576f62c0,python):2022-03-03-07:28:44.866.790 [mindspore/ccsrc/runtime/device/gpu/kernel_info_setter.cc:83] SupportedTypeList] Unsupported op [Ceil] on GPU

Traceback (most recent call last):

  File "train.py", line 477, in

    train(train_paths, s3Client, trainlog, valid_paths)

  File "train.py", line 373, in train

    train_model(train_x, train_y)

  File "/root/miniconda3/envs/py3/lib/python3.7/site-packages/mindspore/nn/cell.py", line 407, in __call__

    out = self.compile_and_run(*inputs)

  File "/root/miniconda3/envs/py3/lib/python3.7/site-packages/mindspore/nn/cell.py", line 734, in compile_and_run

    self.compile(*inputs)

  File "/root/miniconda3/envs/py3/lib/python3.7/site-packages/mindspore/nn/cell.py", line 721, in compile

    _cell_graph_executor.compile(self, *inputs, phase=self.phase, auto_parallel_mode=self._auto_parallel_mode)

  File "/root/miniconda3/envs/py3/lib/python3.7/site-packages/mindspore/common/api.py", line 551, in compile

    result = self._graph_executor.compile(obj, args_list, phase, use_vm, self.queue_name)

RuntimeError: mindspore/ccsrc/runtime/device/gpu/kernel_info_setter.cc:83 SupportedTypeList] Unsupported op [Ceil] on GPU

解答:

可以用mindspore.numpy.ceil 或者你自己实现一个:

ceil(x) = -floor(-x)

ops.Floor算子是支持全平台的。

ItVuer - 免责声明 - 关于我们 - 联系我们

本网站信息来源于互联网,如有侵权请联系:561261067@qq.com

桂ICP备16001015号