HKUST-Aerial-Robotics / Stereo-RCNN

Code for 'Stereo R-CNN based 3D Object Detection for Autonomous Driving' (CVPR 2019)
MIT License
692 stars 177 forks source link

cannot connect to X server #75

Open khawar-islam opened 4 years ago

khawar-islam commented 4 years ago

Error: load checkpoint models_stereo/stereo_rcnn_12_6477.pth load model successfully! Traceback (most recent call last): File "demo.py", line 134, in im_rightdata.data.resize(imgright.size()).copy(img_right) RuntimeError: set_sizes_contiguous is not allowed on a Tensor created from .data or .detach(). If your intent is to change the metadata of a Tensor (such as sizes / strides / storage / storage_offset) without autograd tracking the change, remove the .data / .detach() call and wrap the change in a with torch.no_grad(): block. For example, change: x.data.set_(y) to: with torch.nograd(): x.set(y)

I have changed line 133 _ iminfo.data.resize(info.size()).copy_(info) to iminfo.resize(info.size()).copy(info)

Now error is cannot connect to X server

Zhang-Chaofan commented 4 years ago

I change line 333 in demo.py cv2.imshow('result', im2show) to cv2.imwrite('result.png', im2show)

ycj1124 commented 3 years ago

same questions.did you find the solution?

juhyc commented 1 year ago

I found solution. You have to change line 133 ~ 135 im_leftdata.data.resize(imgleft.size()).copy(img_left) im_rightdata.data.resize(imgright.size()).copy(img_right) iminfo.data.resize(info.size()).copy_(info) to im_leftdata.resize(imgleft.size()).copy(img_left) im_rightdata.resize(imgright.size()).copy(img_right) iminfo.resize(info.size()).copy_(info) just erase .data