pytorch-unsupervised-segmentation-tip icon indicating copy to clipboard operation
pytorch-unsupervised-segmentation-tip copied to clipboard

Could not load the Qt platform plugin "xcb"

Open harishkashyap opened this issue 4 years ago • 4 comments

python demo.py --input ./BSD500/101027.jpg /home/ubuntu/anaconda3/envs/pytorch_p36/lib/python3.6/site-packages/torch/nn/_reduction.py:43: UserWarning: size_average and reduce args will be deprecated, please use reduction='mean' instead. warnings.warn(warning.format(ret)) qt.qpa.xcb: could not connect to display qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "/home/ubuntu/anaconda3/envs/pytorch_p36/lib/python3.6/site-packages/cv2/qt/plugins" even though it was found. This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: xcb, eglfs, minimal, minimalegl, offscreen, vnc, webgl.

Aborted (core dumped)

harishkashyap avatar Jun 15 '21 18:06 harishkashyap

Are you using ssh or somehow running remotely?

mucozcan avatar Aug 23 '21 13:08 mucozcan

@mucozcan hi, I use ssh remote connecting, I also met this error. Could you help me ? Looking forward to your reply! Thanks a lot!

clytze0216 avatar Aug 27 '21 07:08 clytze0216

@mucozcan hi, I use ssh remote connecting, I also met this error. Could you help me ? Looking forward to your reply! Thanks a lot!

Hi, sorry for late reply. By using ssh, you can't access the host machine's display engine directly. You can write inference results in remote file system and transfer to your workspace. Display functions like cv2.imshow() wouldn't work through ssh.

mucozcan avatar Aug 30 '21 07:08 mucozcan

"You can resolve this issue by modifying the code located at line 135 from 'cv2.imshow( "output", im_target_rgb )' to 'cv2.imwrite('/path/to/your/dic/result.jpg', im_target_rgb)'."

weltzj avatar Dec 06 '23 12:12 weltzj