- Troubleshooting
- Submitting a git issue
- Clean reset
- Bad tracking performances
- Errors
- ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts
- ImportError: /home/.../anaconda3/envs/pyslam/bin/../lib/libgcc_s.so.1: version `GCC_12.0.0' not found (required by /lib/x86_64-linux-gnu/libhwy.so.1)
- RuntimeError: The detected CUDA version (11.8) mismatches the version that was used to compile
- Gtk-ERROR **: ... GTK+ 2.x symbols detected. Using GTK+ 2.x and GTK+ 3 in the same process is not supported
- SURF error
- g2o Errors
- OrderedSet error
- Import erros related to ROS and OpenCV
- Could not import PILLOW_VERSION from PIL
- ValueError: ndarray is not C-contiguous
- Error: python3: malloc.c:2401: sysmalloc: Assertion `(old_top == initial_top (av) && old_size == 0) ...
- When loading a neural network with CUDA everything gets stuck
- Manual install instead of using the provided install scripts
This page contains a small collections of issues/errors that may be experienced along with their fixes.
FIRST OF ALL:
- Did you read the main README page?
- Did you use the provided INSTALL SCRIPTS?
If not then go back on the README page, read the few lines in the install section and launch the REQUIRED install script. The install scripts were created to perform all the required install operations for you and make the install process itself as smooth and painless as possible.
If you work under Ubuntu or MacOS, check the specific installation procedures reported in the main README page.
For faster support when opening a new git issue, please provide the following information:
- Git commit (ensure you are on lastest `master' commit)
- Dataset used
- Code configuration:
- Modified parameters in
config.yaml
- Modified parameters in
config_parameters.py
- Any other changes made to the codebase
- Modified parameters in
- System configuration:
- OS, CUDA version, etc.
- Full console log
Providing this information is essential for reproducing and debugging the issue efficiently.
If you want to perform a clean reset and launch a fresh new install (rebuilding everything from scratch), run the following commands:
./clean.sh --hard # clean build folders
./pyenv-delete.sh # delete the "pyslam" virtual environment
Due to the multi-threading system (tracking thread + local mapping thread) and the non-super-fast performances of the python implementations (indeed, python is not actually multithreading), bad tracking performances may occur and vary depending on your machine computation capabilities. In a few words, it may happen that the local mapping thread is not fast enough to spawn new map points in time for the tracking thread. In fact, new spawned map points are necessary to let the tracking thread find enough {keypoint}-{map point} correspondences, and hence stably grasp at the map and proceed along its estimated trajectory. Simply put, the local mapping thread continuously builds/unrolls the fundamental 'carpet' of points (the map) on which the tracking thread 'walks': no 'carpet', no party!
If you experience bad tracking performances, go in config_parameters.py and try to set kTrackingWaitForLocalMappingToGetIdle=True
.
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts
I have verified through numerous installation tests that the errors reported by pip's dependency resolver are typically warnings rather than critical issues. These messages do not prevent the main and test scripts from running successfully.
ImportError: /home/.../anaconda3/envs/pyslam/bin/../lib/libgcc_s.so.1: version `GCC_12.0.0' not found (required by /lib/x86_64-linux-gnu/libhwy.so.1)
If you hit this issue, please refer to this discussion.
If you get the following error (or a similar one)
RuntimeError:
The detected CUDA version (11.8) mismatches the version that was used to compile
PyTorch (12.1). Please make sure to use the same CUDA versions.
then your detected CUDA version should actually be 11.8 and the following command might help:
pip install torch==2.2.0+cu118 torchvision==0.17+cu118 --index-url https://download.pytorch.org/whl/cu118
Another solution is to install CUDA 12.1, as suggested by the error message.
To know which CUDA version is required by your installed torch version, you can run:
python -c "import torch; print(torch.__version__)"
In case your dected CUDA version is a different one, you can easily adjust the above command by changing the cuXYZ
version code. See this reference for further details:
https://pytorch.org/get-started/previous-versions/
Gtk-ERROR **: ... GTK+ 2.x symbols detected. Using GTK+ 2.x and GTK+ 3 in the same process is not supported
If you hit such an error then decomment (or add) the following code in both main_vo.py
and main_slam.py
# fix from https://github.com/tum-vision/fastfusion/issues/21
import gi
gi.require_version('Gtk', '2.0')
this will solve the problem.
In order to use non-free OpenCV features (i.e. SURF, etc.), you need to install the module opencv-contrib-python
built with the enabled option OPENCV_ENABLE_NONFREE
.
The provided install scripts will install a recent opencv version (>=4.10) with non-free modules enabled (see the provided scripts install_pip3_packages.sh and install_opencv_python.sh). To quickly verify your installed opencv version run:
$ . pyenv-activate.sh
$ ./scripts/opencv_check.py
or use the following command:
$ python3 -c "import cv2; print(cv2.__version__)"
How to check if you have non-free OpenCV module support (no errors imply success):
$ python3 -c "import cv2; detector = cv2.xfeatures2d.SURF_create()"
If you run into the following error
File ".../pyslam/optimizer_g2o.py", line 96, in optimization
edge.fx = f.fx
AttributeError: 'g2o.EdgeSE3ProjectXYZ' object has no attribute 'fx'
that's because you did not run the script
$ ./install_thirdparty.sh
as explained in the main README file. That's required in order to properly build and install the required thirdparty libs. Please,follow these steps:
- check you are on the correct pyslam branch according to your OS
- use the pyslam install scripts
- open a terminal in the root folder of the repo clean with
$ ./clean.sh
- launch a new install with
$ ./install_all_venv.sh
- Please, double check that you have the file like
thirdparty/g2opy/lib/g2o.cpython-36m-x86_64-linux-gnu.so
.
If you get an error message like
import g2o
ModuleNotFoundError: No module named 'g2o' error
First of all, check if you have a compiled thirdparty/g2opy/lib/g2o.cpython-*-linux-gnu.so
. If not, Did you use one of the install_all scripts? Depending on your selected working environment (native, conda, python3-venv), you need to launch its companion install_all script in order to actually install all the required libraries (including g2o). Please, read the install instruction in the main README file.
On the other hand, if you already have a compiled thirdparty/g2opy/lib/g2o.cpython-*-linux-gnu.so
, it's very likely you have libraries compiled in a 'mixed' way. Then, try to clean everything with the script clean.sh
, and follow the installation procedure again (see the main README file).
Last but not least, please recall that you need to activate your pyenv
/conda
environment before launching any pySLAM script.
Reference: #48
If you run main_slam.py
and hit the following error
File "/home/dam/.local/lib/python3.5/site-packages/ordered_set.py", line 134, in copy
return self.class(self)
File "/home/dam/.local/lib/python3.5/site-packages/ordered_set.py", line 69, in init
self |= iterable
TypeError: unsupported operand type(s) for |=: 'OrderedSet' and 'OrderedSet'
You can solve such an issue by installing a lower version of OrderedSet
pip install ordered-set==3.1.1 --force-reinstall
If you have ROS installed in your system and got the following error:
ImportError: /opt/ros/kinetic/lib/python2.7/dist-packages/cv2.so:
undefined symbol: PyCObject_Type
You can run the following command in your shell:
$ export PYTHONPATH=""
this will remove the ROS OpenCV python modules from your python path and will solve the issue.
Or ImportError: cannot import name 'PILLOW_VERSION'
If you get this error, it is very likely that pillow 7.0.0 has some troubles with pytorch. In order to solve this error, run
$ pip3 uninstall pillow
$ pip3 install pillow==6.2.2
(fix from this page)
If the following error pops-up:
ValueError: ndarray is not C-contiguous
Open pyslam/search_points.py, find this line (should be line 79):
projs = f_cur.project_map_points(points)
and replace it with :
projs = f_cur.project_map_points(points)
projs = projs.copy(order='C')
(thanks to naughtyStark)
Error: python3: malloc.c:2401: sysmalloc: Assertion `(old_top == initial_top (av) && old_size == 0) ...
I got this error after messing up with the installation of different python packages related to torch and torchvision. The result was that tfeat was generating segmentation faults. In order to check if this is actually your case, run
$ cd test/cv # this is compulsory
$ python3 test_tfeat.py
and check if you get a segmenation fault. If this is the case, try to run
$ pip3 uninstall torch torchvision
$ pip3 install torch torchvision
in order to get a clean installation of the torch packages.
I got this issue with a new NVIDIA GPU while loading SuperPoint
neural network. The NN loading got stuck. This error arises when CUDA code was not compiled to target your GPU architecture. Two solutions:
- Easy: turn off CUDA (for instance, with
SuperPointFeature2D()
set the default class optiondo_cuda=False
). In this case, the computations will be moved to CPU. - You need to install a pytorch version that is compatible with your CUDA version and GPU architecture. See for instance these two links: https://stackoverflow.com/questions/75682385/runtimeerror-cuda-error-no-kernel-image-is-available-for-execution-on-the-devi https://discuss.pytorch.org/t/failed-to-load-image-python-extension-could-not-find-module/140278
If you really want to install things manually instead of using the install scripts, follow the same steps of the install scripts, and good luck!