vt-vl-lab / 3d-photo-inpainting

[CVPR 2020] 3D Photography using Context-aware Layered Depth Inpainting
https://shihmengli.github.io/3D-Photo-Inpainting/
Other
6.93k stars 1.11k forks source link

Trying CPU only mode in Google colab - "Could not load the Qt platform plugin "xcb" in "" even though it was found." #100

Open idunnostuff opened 4 years ago

idunnostuff commented 4 years ago

Hi there,

I have very limited coding experience and i'm trying to get it to work. Unfortunately i have outdated hardware and no GPU that supports CUDA. So iam running this is a Google Colab which has currently disabled GPU usage for me to save resources. I plan to try CPU only (gpu_ids: -1 in argument.yml).

Then I had a problem with PyQt RuntimeError: Could not import any of the backends. You need to install any of ['PyQt4', 'PyQt5', 'PySide', 'PySide2', 'Pyglet', 'Glfw', 'SDL2', 'wx', 'EGL', 'osmesa']. We recommend PyQt

I have tried this solution here: https://github.com/vt-vl-lab/3d-photo-inpainting/issues/83

The installation looks to work but $ qtchooser -run-tool=designer -qt=5 diddnt seems to work for me and i tried it to edit manuelly in /usr/lib/x86_64-linux-gnu/qt-default/qtchooser/default.conf" but i dont have the path qt-default/qtchooser/default.conf only /usr/lib/x86_64-linux-gnu/qt5/qt.conf (Im not sure if i have to do this)

//Edit: Actually i was wrong, it looks like PyQt "could not connect to any X display" after i try to install.

Processing triggers for systemd (237-3ubuntu10.42) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Processing triggers for dbus (1.12.2-1ubuntu1.2) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Processing triggers for mime-support (3.60ubuntu1) ...
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
qt.qpa.screen: QXcbConnection: Could not connect to display 
Could not connect to any X display.

When i try to run !python main.py --config argument.yml now after i tryd to installed PyQt im stuck now with this error:

Writing depth ply (and basically doing everything) at 1598568547.0168715
Writing mesh file mesh/26.11.2001.ply ...
Making video at 1598568978.7456522
fov: 53.13010235415598
WARNING: could not connect to display 
WARNING: Could not load the Qt platform plugin "xcb" in "" even though it was found.
WARNING: This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl, xcb.

it looks like i am only a few steps away from rendering, but what now? any ideas? :(

LemonATsu commented 4 years ago

Try setting offscreen_rendering in argument.yml to True and see if that works.

idunnostuff commented 4 years ago

Try setting offscreen_rendering in argument.yml to True and see if that works.

Thank you, i try'd that but it diddn't work. As far i understand it !sed -i 's/offscreen_rendering: True/offscreen_rendering: False/g' argument.yml should do that too. It is possible that I forgot to use it during the last tests, but still no success.

I forgot to mention that i also updated the main.py to this, to get a few steps further: vispy.use(app='PyQt5')

Here is the latest output from the log:

running on device cpu
  0% 0/3 [00:00<?, ?it/s]Current Source ==>  26.11.2001
Running depth extraction at 1598584617.3614085
initialize
device: cpu
start processing
  processing image/26.11.2001.jpg (1/1)
torch.Size([1, 3, 288, 384])
finished
Start Running 3D_Photo ...
Loading edge model at 1598584632.510814
Loading depth model at 1598584632.7207887
Loading rgb model at 1598584633.5015664
Writing depth ply (and basically doing everything) at 1598584634.3202562
Writing mesh file mesh/26.11.2001.ply ...
Making video at 1598585088.2973251
fov: 53.13010235415598
WARNING: could not connect to display 
WARNING: Could not load the Qt platform plugin "xcb" in "" even though it was found.
WARNING: This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl, xcb.

//Edit: I added these lines in the colab to install PyQt:

!pip3 install --user pyqt5  
!sudo apt-get install python3-pyqt5  
!sudo apt-get install pyqt5-dev-tools
!sudo apt-get install qttools5-dev-tools
!qtchooser -run-tool=designer -qt=5

but when i try to run this: !qtchooser -run-tool=designer -qt=5 Google Colab returns /bin/bash: qtchooser: command not found Im not sure but i feel like this is part of the problem?

zdhernandez commented 4 years ago

I'm running into the same issue. @idunnostuff Did you solve this issue ?

ansj11 commented 3 years ago

@idunnostuff i also have the same issue on my linux machine, Did you solve this issue ?

ansj11 commented 3 years ago

I find a solution to solve this problem, i am running on a remote terminal, that need virtual display to show the rendering window. like this link: https://www.jianshu.com/p/7df287155ce0

satindergrewal commented 1 year ago

Try setting offscreen_rendering in argument.yml to True and see if that works.

YES! This fixed my issue! Thank you 🙏