fluid.layers.topk出现Begin index must be less than end index in ddim slice.
Created by: xieqingxing
在写loss函数时需要用到fluid.layers.topk,出现了如下错误
paddle.fluid.core.EnforceNotMet: Begin index must be less than end index in ddim slice. at [/paddle/paddle/fluid/framework/ddim.cc:235]
代码是:
errors = fluid.layers.abs(fg - crop_logit)
errors_sorted, perm = fluid.layers.topk(errors,k=errors.shape[0])
errors的维度是103041
把K改为1之后还是一样报错
但如果使用fluid.layers.argsort就不会报错了
麻烦求解答
环境是 cuda9.0 cudnn7.0 paddlepaddle-gpu版本:1.2.1.post97