Open khawar-islam opened 4 years ago
I change line 333 in demo.py cv2.imshow('result', im2show) to cv2.imwrite('result.png', im2show)
same questions.did you find the solution?
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
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