ZhanYang-nwpu / RSVG-pytorch

RSVG: Exploring Data and Model for Visual Grounding on Remote Sensing Data, 2022
106 stars 4 forks source link

Cuda error #10

Closed Hasanmog closed 1 year ago

Hasanmog commented 1 year ago

Hello , I was trying this model on one image in DIOR dataset. I am facing this error: `---------------------------------------------------------------------------

RuntimeError Traceback (most recent call last)

in <cell line: 7>() 6 7 with torch.no_grad(): ----> 8 pred_bbox = model(image, masks, word_id, word_mask) 9 10 # Convert to (x1, y1, x2, y2) format

3 frames

/content/RSVG-pytorch/models/CNN_MGVLF.py in forward(self, fv, fl) 166 167 pos = self.pos(x0).to(x0.dtype) --> 168 mask = torch.zeros([bs, x0.shape[2]]).cuda() 169 mask = mask.bool() 170 out = self.transformer(x0, mask, pos)

RuntimeError: CUDA error: device-side assert triggered CUDA kernel errors might be asynchronously reported at some other API call, so the stacktrace below might be incorrect. For debugging consider passing CUDA_LAUNCH_BLOCKING=1. Compile with TORCH_USE_CUDA_DSA to enable device-side assertions. ---------------------------------------------------------------------------' And thats after putting the args.size as 640 , the main problem is fixed when I place in the letterbox function 320 instead of 640 as third argument . However , although the error is removed , the output is wrong(seen by visualizing) image I used the same image and phrase you used. Moreover, each time I rerun the model on the same input , I get different bbox. Any ideas?