AceCoooool/RoIAlign-RoIPool-pytorch

CUDA Eerror:an illegal memory access was encountered

dbwzyh opened this issue · 0 comments

class ROIPoolFunction(Function): @staticmethod def forward(ctx, feat, rois, pool_h, pool_w, scale, train): ctx.rois = rois ctx.feat_size = feat.size() ctx.pool_h = pool_h ctx.pool_w = pool_w if train: ctx.memory = torch.zeros((rois.size(0), feat.size(1), pool_h, pool_w), dtype=torch.int) else: ctx.memory = torch.zeros(0) if feat.is_cuda: ctx.memory = ctx.memory.cuda() output = roi_pool_cuda.forward_cuda(feat, rois, pool_h, pool_w, scale, ctx.memory) else: output = roi_pool_cpu.forward_cpu(feat, rois, pool_h, pool_w, scale, ctx.memory) return output

ctx.memory = torch.zeros(0)
i found this line will lead to the runtime error :CUDA Eerror:an illegal memory access was encountered