PRBonn / semantic-kitti-api

SemanticKITTI API for visualizing dataset, processing data, and evaluating results.
http://semantic-kitti.org
MIT License
783 stars 187 forks source link

The visualization window does not show up #108

Closed JzHuai0108 closed 2 years ago

JzHuai0108 commented 2 years ago

Hi, thank you for the great tool. I have installed the tool according to the readme, but the visualization window does not appear without fatal errors. I browsed the issues, the closest to mine is issue23, but it is caused by using a remote desktop. Can you please hint on how to solve this issue?

Detailed descriptions are as follows. I am working in a python 3.7 virtual environment on Ubuntu 18.04.

The terminal outputs:

(python3.7-env) jhuai@ThinkPad-P53:/lidarslam/semantic-kitti-api$ python3.7 visualize.py --sequence 00 --dataset /data/KITTI/semantic/dataset
********************************************************************************
INTERFACE:
Dataset /data/KITTI/semantic/dataset
Config config/semantic-kitti.yaml
Sequence 00
Predictions None
ignore_semantics False
do_instances False
ignore_safety False
offset 0
********************************************************************************
Opening config file config/semantic-kitti.yaml
Sequence folder exists! Using sequence from /data/KITTI/semantic/dataset/sequences/00/velodyne
Labels folder exists! Using labels from /data/KITTI/semantic/dataset/sequences/00/labels
Using semantics in visualizer
To navigate:
    b: back (previous scan)
    n: next (next scan)
    q: quit (exit program)
/media/jhuai/docker/python3.7-env/lib/python3.7/site-packages/vispy/gloo/texture.py:45: UserWarning: GPUs can't support dtypes bigger than 32-bit, but got 'float64'. Precision will be lost due to downcasting to 32-bit.
  f"GPUs can't support dtypes bigger than 32-bit, but got '{dtype}'. "

All the required packages have been installed, as show below.

(python3.7-env) jhuai@ThinkPad-P53:/lidarslam/semantic-kitti-api$ pip list
DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.
actionlib (1.12.0)
angles (1.9.11)
base-local-planner (1.16.7)
bondpy (1.8.3)
camera-calibration (1.14.0)
camera-calibration-parsers (1.11.13)
catkin (0.7.20)
controller-manager (0.16.0)
controller-manager-msgs (0.16.0)
cv-bridge (1.13.0)
cycler (0.11.0)
Cython (0.29.32)
diagnostic-analysis (1.9.3)
diagnostic-common-diagnostics (1.9.3)
diagnostic-updater (1.9.3)
dynamic-reconfigure (1.6.0)
fonttools (4.38.0)
freetype-py (2.3.0)
gazebo-plugins (2.8.6)
gazebo-ros (2.8.6)
gencpp (0.6.2)
geneus (2.2.6)
genlisp (0.4.16)
genmsg (0.5.12)
gennodejs (2.0.1)
genpy (0.6.9)
hsluv (5.0.3)
image-geometry (1.13.0)
interactive-markers (1.11.4)
joint-state-publisher (1.12.14)
kdl-parser-py (1.13.1)
kiwisolver (1.4.4)
laser-geometry (1.6.4)
matplotlib (3.5.3)
message-filters (1.14.3)
numpy (1.21.6)
packaging (21.3)
Pillow (9.3.0)
pip (9.0.1)
pkg-resources (0.0.0)
pyparsing (3.0.9)
python-dateutil (2.8.2)
python-qt-binding (0.3.6)
PyYAML (6.0)
qt-dotgraph (0.3.16)
qt-gui (0.3.16)
qt-gui-cpp (0.3.16)
qt-gui-py-common (0.3.16)
resource-retriever (1.12.5)
rosbag (1.14.3)
rosboost-cfg (1.14.7)
rosclean (1.14.7)
roscreate (1.14.7)
rosgraph (1.14.3)
roslaunch (1.14.3)
roslib (1.14.7)
roslint (0.11.2)
roslz4 (1.14.3)
rosmake (1.14.7)
rosmaster (1.14.3)
rosmsg (1.14.3)
rosnode (1.14.3)
rosparam (1.14.3)
rospy (1.14.3)
rosserial-python (0.8.0)
rosservice (1.14.3)
rostest (1.14.3)
rostopic (1.14.3)
rosunit (1.14.7)
roswtf (1.14.3)
rqt-action (0.4.9)
rqt-bag (0.4.12)
rqt-bag-plugins (0.4.12)
rqt-console (0.4.9)
rqt-dep (0.4.9)
rqt-graph (0.4.11)
rqt-gui (0.5.0)
rqt-gui-py (0.5.0)
rqt-image-view (0.4.14)
rqt-launch (0.4.8)
rqt-logger-level (0.4.8)
rqt-moveit (0.5.7)
rqt-msg (0.4.8)
rqt-nav-view (0.5.7)
rqt-plot (0.4.9)
rqt-pose-view (0.5.8)
rqt-publisher (0.4.8)
rqt-py-common (0.5.0)
rqt-py-console (0.4.8)
rqt-reconfigure (0.5.1)
rqt-robot-dashboard (0.5.7)
rqt-robot-monitor (0.5.9)
rqt-robot-steering (0.5.10)
rqt-runtime-monitor (0.5.7)
rqt-rviz (0.6.0)
rqt-service-caller (0.4.8)
rqt-shell (0.4.9)
rqt-srv (0.4.8)
rqt-tf-tree (0.6.0)
rqt-top (0.4.8)
rqt-topic (0.4.11)
rqt-web (0.4.8)
rtabmap-ros (0.20.18)
rviz (1.13.7)
sensor-msgs (1.12.7)
setuptools (39.0.1)
six (1.16.0)
smach (2.0.1)
smach-ros (2.0.1)
smclib (1.8.3)
tf (1.12.0)
tf-conversions (1.12.0)
tf2-geometry-msgs (0.6.5)
tf2-kdl (0.6.5)
tf2-py (0.6.5)
tf2-ros (0.6.5)
topic-tools (1.14.3)
turtlebot3-teleop (1.2.5)
typing-extensions (4.4.0)
urdfdom-py (0.4.2)
vispy (0.12.0)
xacro (1.13.5)
JzHuai0108 commented 2 years ago

Sorry to bother you with the queer problem which I solved it an hour later. The root cause is PyQt5 is not installed in the virtual environment though it is installed in the system. The story is very complicated and I narrate it here for myself and the curious.

At the start, I installed all the python3 requirements on the system (ubuntu 18.04, python3.6.9 by default) following the readme,

sudo apt install python3-dev python3-pip python3-pyqt5.qtopengl
sudo pip3 install -r requirements.txt

Then, when I ran visualize.py of the semantic-kitti-api

Traceback (most recent call last):
  File "visualize_mos.py", line 9, in <module>
    from auxiliary.laserscanvis import LaserScanVis
  File "/media/jhuai/docker/lidarslam/semantic-kitti-api/auxiliary/laserscanvis.py", line 5, in <module>
    from vispy.scene import visuals, SceneCanvas
  File "/usr/local/lib/python3.6/dist-packages/vispy/scene/__init__.py", line 33, in <module>
    from .visuals import *  # noqa
  File "/usr/local/lib/python3.6/dist-packages/vispy/scene/visuals.py", line 18, in <module>
    from .. import visuals
  File "/usr/local/lib/python3.6/dist-packages/vispy/visuals/__init__.py", line 44, in <module>
    from .volume import VolumeVisual  # noqa
  File "/usr/local/lib/python3.6/dist-packages/vispy/visuals/volume.py", line 37
    from __future__ import annotations
    ^
SyntaxError: future feature annotations is not defined

According to here, I had to upgrade my python to 3.7 at least. However, my entire ros system packages depend on python3.6.9. So I wanted to work in a virtual environment for python 3.7. But I need python3.7 installed on the system in order to make the virtual env. Fortunately, the ubuntu package archive has libpython3.7 and other related packages. So I installed them system wide by sudo apt-get install.

sudo apt-get install libpython3.7 libpython3.7-dev python3.7-venv

Now I could make a virtual environment based on python 3.7,

python3.7 -m venv python3.7-env

and then installed the requirements packages.

source python3.7-env/bin/activate
pip3 install numpy
sudo pip3 install -r requirements.txt

Everything looked fine. But the visualization windows did not appear. Some hint showed up when running

pip3 install -r requirements.txt

in the virtual environment, warning that "No matching distribution found for PyQt5-Qt5>=5.15.0". Since I was sure that PyQt5-Qt5 was installed systemwide, I thought the cause for failing to create the windows in the virtual env should be that the system wide PyQt5 was not found in the virtual env. So I uninstalled the system wide PyQt5, since it was useless.

sudo apt-get remove python3-pyqt5.qtopengl

Then I focused on installing PyQt5 in the virtual env. It turned out that the pip needed a upgrade as suggested on stackoverflow.

pip install --upgrade pip

With that, PyQt5 was successfully installed in the virtual env, among others, by calling

pip3 install -r requirements.txt
# pip3 install PyQt5-Qt5 # alternatively

The current python packages in the virtual env look like

(python3.7-env) jhuai@ThinkPad-P53:/lidarslam/semantic-kitti-api$ pip list
Package                       Version
----------------------------- ----------
actionlib                     1.12.0
angles                        1.9.11
base_local_planner            1.16.7
bondpy                        1.8.3
camera_calibration            1.14.0
camera_calibration_parsers    1.11.13
catkin                        0.7.20
controller_manager            0.16.0
controller_manager_msgs       0.16.0
cv_bridge                     1.13.0
cycler                        0.11.0
Cython                        0.29.32
diagnostic_analysis           1.9.3
diagnostic_common_diagnostics 1.9.3
diagnostic_updater            1.9.3
dynamic_reconfigure           1.6.0
fonttools                     4.38.0
freetype-py                   2.3.0
gazebo_plugins                2.8.6
gazebo_ros                    2.8.6
gencpp                        0.6.2
geneus                        2.2.6
genlisp                       0.4.16
genmsg                        0.5.12
gennodejs                     2.0.1
genpy                         0.6.9
glfw                          2.5.5
hsluv                         5.0.3
image_geometry                1.13.0
imgui                         1.4.1
interactive_markers           1.11.4
joint_state_publisher         1.12.14
kdl_parser_py                 1.13.1
kiwisolver                    1.4.4
laser_geometry                1.6.4
matplotlib                    3.5.3
message_filters               1.14.3
numpy                         1.21.6
nvidia-cublas-cu11            11.10.3.66
nvidia-cuda-nvrtc-cu11        11.7.99
nvidia-cuda-runtime-cu11      11.7.99
nvidia-cudnn-cu11             8.5.0.96
packaging                     21.3
Pillow                        9.3.0
pip                           22.3.1
pkg_resources                 0.0.0
PyOpenGL                      3.1.6
pyparsing                     3.0.9
PyQt5                         5.15.7
PyQt5-Qt5                     5.15.2
PyQt5-sip                     12.11.0
python-dateutil               2.8.2
python_qt_binding             0.3.6
PyYAML                        6.0
qt_dotgraph                   0.3.16
qt_gui                        0.3.16
qt_gui_cpp                    0.3.16
qt_gui_py_common              0.3.16
resource_retriever            1.12.5
rosbag                        1.14.3
rosboost_cfg                  1.14.7
rosclean                      1.14.7
roscreate                     1.14.7
rosgraph                      1.14.3
roslaunch                     1.14.3
roslib                        1.14.7
roslint                       0.11.2
roslz4                        1.14.3
rosmake                       1.14.7
rosmaster                     1.14.3
rosmsg                        1.14.3
rosnode                       1.14.3
rosparam                      1.14.3
rospy                         1.14.3
rosserial_python              0.8.0
rosservice                    1.14.3
rostest                       1.14.3
rostopic                      1.14.3
rosunit                       1.14.7
roswtf                        1.14.3
rqt_action                    0.4.9
rqt_bag                       0.4.12
rqt_bag_plugins               0.4.12
rqt_console                   0.4.9
rqt_dep                       0.4.9
rqt_graph                     0.4.11
rqt_gui                       0.5.0
rqt_gui_py                    0.5.0
rqt_image_view                0.4.14
rqt_launch                    0.4.8
rqt_logger_level              0.4.8
rqt_moveit                    0.5.7
rqt_msg                       0.4.8
rqt_nav_view                  0.5.7
rqt_plot                      0.4.9
rqt_pose_view                 0.5.8
rqt_publisher                 0.4.8
rqt_py_common                 0.5.0
rqt_py_console                0.4.8
rqt_reconfigure               0.5.1
rqt_robot_dashboard           0.5.7
rqt_robot_monitor             0.5.9
rqt_robot_steering            0.5.10
rqt_runtime_monitor           0.5.7
rqt_rviz                      0.6.0
rqt_service_caller            0.4.8
rqt_shell                     0.4.9
rqt_srv                       0.4.8
rqt_tf_tree                   0.6.0
rqt_top                       0.4.8
rqt_topic                     0.4.11
rqt_web                       0.4.8
rtabmap-ros                   0.20.18
rviz                          1.13.7
sensor_msgs                   1.12.7
setuptools                    39.0.1
six                           1.16.0
smach                         2.0.1
smach_ros                     2.0.1
smclib                        1.8.3
tf                            1.12.0
tf_conversions                1.12.0
tf2_geometry_msgs             0.6.5
tf2_kdl                       0.6.5
tf2_py                        0.6.5
tf2_ros                       0.6.5
topic_tools                   1.14.3
torch                         1.13.0
turtlebot3_teleop             1.2.5
typing_extensions             4.4.0
urdfdom_py                    0.4.2
vispy                         0.12.0
wheel                         0.38.4
xacro                         1.13.5

After all these tinkering, the visualization windows finally came up.

twowins

YEOMJINSEOP commented 10 months ago

this issue helpd me a lot. thank you for sharing your history