Skip to content
New issue

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

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

Already on GitHub? # to your account

cannot connect to X server #75

Open
khawar-islam opened this issue Jul 1, 2020 · 3 comments
Open

cannot connect to X server #75

khawar-islam opened this issue Jul 1, 2020 · 3 comments

Comments

@khawar-islam
Copy link

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_right_data.data.resize_(img_right.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.no_grad():
x.set_(y)

I have changed line 133
_ im_info.data.resize_(info.size()).copy_(info)
to
im_info.resize_(info.size()).copy_(info)
_

Now error is
cannot connect to X server

@Zhang-Chaofan
Copy link

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

@ycj1124
Copy link

ycj1124 commented Oct 17, 2021

same questions.did you find the solution?

@juhyc
Copy link

juhyc commented Aug 23, 2023

I found solution.
You have to change line 133 ~ 135
im_left_data.**data.**resize_(img_left.size()).copy_(img_left)
im_right_data.**data.**resize_(img_right.size()).copy_(img_right)
im_info.**data.**resize_(info.size()).copy_(info)
to
im_left_data.resize_(img_left.size()).copy_(img_left)
im_right_data.resize_(img_right.size()).copy_(img_right)
im_info.resize_(info.size()).copy_(info)
just erase .data

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

No branches or pull requests

4 participants