Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CUDA Eerror:an illegal memory access was encountered #9

Open
dbwzyh opened this issue Jul 1, 2021 · 0 comments
Open

CUDA Eerror:an illegal memory access was encountered #9

dbwzyh opened this issue Jul 1, 2021 · 0 comments

Comments

@dbwzyh
Copy link

dbwzyh commented Jul 1, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant