CenterNet
CenterNet copied to clipboard
qt.qpa.xcb: could not connect to display
When I run python demo.py ctdet --demo ../images/ --load_model ../models/ctdet_coco_dla_2x.pth, some error as follows:
Creating model... loaded ../models/ctdet_coco_dla_2x.pth, epoch 230 qt.qpa.xcb: could not connect to display qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "/root/anaconda3/envs/CenterNet/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.
Aborted (core dumped)
please help me, thank you.
I haven't met this. Can you try re-installing opencv via pip install opencv-python
?
cd /src/lib/detectors/ctdet.py
, in line 96, replace debugger.show_all_imgs(pause=self.pause)
with debugger.save_all_imgs(path='/home/xxx/CenterNet/output', genID=True)
@Ineedangoodidea , did you resolve this? I am running on remote machine, and also got this display error. Reinstalling opencv-python did not fix. Edit: This the issue? https://github.com/xingyizhou/CenterNet/blob/master/src/demo.py#L29 Edit2: For images, it is in https://github.com/xingyizhou/CenterNet/blob/master/src/lib/detectors/base_detector.py#L82 Edit3: For images, it is in show_results here: https://github.com/xingyizhou/CenterNet/blob/master/src/lib/detectors/base_detector.py#L140
Solution (to save image, instead of show it):
- Create the directory that serves as the default destination for saved images, with
mkdir $CenterNet_ROOT/src/cache/debug -p
. - If using ctdet, in line 96 of
src/lib/detectors/ctdet.py
, replaceshow_all_images(...)
withsave_all_images()
<-- no arguments.
For the one facing this issue: @diesendruck works just in 2nd step use debugger.save_all_imgs()
not debugger.save_all_images()
@Ineedangoodidea I had a similar issue lately after a fresh install of linux.
Unfortunately, none of the answers related to this same issue fixed my problem.
What seemed to fix it is
sudo apt-get install freeglut3-dev
Hope it helps
Open your terminal just hit following command..works like charm..
$ export DISPLAY=:1.0
export DISPLAY=:0.0 worked for me