cvg / pixel-perfect-sfm

Pixel-Perfect Structure-from-Motion with Featuremetric Refinement (ICCV 2021, Best Student Paper Award)
Apache License 2.0
1.34k stars 139 forks source link

Error about boost #139

Closed empty-spacebar closed 8 months ago

empty-spacebar commented 8 months ago

After successfully finishing the installation, I run the jupyter demo.

But here comes the error:

ImportError                               Traceback (most recent call last)
Cell In[1], line 11
      8 from hloc.visualization import plot_images, read_image
      9 from hloc.utils.viz_3d import init_figure, plot_points, plot_reconstruction, plot_camera_colmap
---> 11 from pixsfm.util.visualize import init_image, plot_points2D
     12 from pixsfm.refine_hloc import PixSfM
     13 from pixsfm import ostream_redirect

File /home/program/pixel-perfect-sfm/pixsfm/__init__.py:17
     14 logger.propagate = False
     16 import pyceres  # noqa F403
---> 17 from ._pixsfm import *  # noqa F403
     19 from . import (  # noqa F403
     20     base, features, bundle_adjustment, keypoint_adjustment,
     21     extract, localization, util, cpplog
     22 )
     24 cpplog.level = 1  # do not log DEBUG

ImportError: /home/program/pixel-perfect-sfm/pixsfm/_pixsfm.cpython-310-x86_64-linux-gnu.so: undefined symbol: _ZN5boost10filesystem6detail28directory_iterator_constructERNS0_18directory_iteratorERKNS0_4pathEjPNS1_25directory_iterator_paramsEPNS_6system10error_codeE

And here is my conda list:

# packages in environment at /root/miniconda3/envs/ppsfm2:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                 conda_forge    conda-forge
_openmp_mutex             4.5                       2_gnu    conda-forge
alsa-lib                  1.2.11               hd590300_1    conda-forge
antlr-python-runtime      4.9.3              pyhd8ed1ab_1    conda-forge
asttokens                 2.0.5              pyhd3eb1b0_0    defaults
attr                      2.5.1                h166bdaf_1    conda-forge
beautifulsoup4            4.12.3                   pypi_0    pypi
blas                      1.0                         mkl    defaults
brotli                    1.0.9                h5eee18b_7    defaults
brotli-bin                1.0.9                h5eee18b_7    defaults
brotli-python             1.0.9           py310h6a678d5_7    defaults
bzip2                     1.0.8                h5eee18b_5    https://repo.anaconda.com/pkgs/main
c-ares                    1.27.0               hd590300_0    conda-forge
ca-certificates           2024.3.11            h06a4308_0    https://repo.anaconda.com/pkgs/main
cached-property           1.5.2                      py_0    defaults
cairo                     1.18.0               h3faef2a_0    conda-forge
ceres-solver              2.2.0                h2ea6fbf_1    conda-forge
certifi                   2024.2.2        py310h06a4308_0    defaults
charset-normalizer        2.0.4              pyhd3eb1b0_0    defaults
colmap                    3.8             gpuhde9e9d0_110    conda-forge
comm                      0.2.1           py310h06a4308_0    defaults
contourpy                 1.2.0           py310hdb19cb5_0    defaults
cuda-cudart               11.8.89                       0    nvidia
cuda-cupti                11.8.87                       0    nvidia
cuda-libraries            11.8.0                        0    nvidia
cuda-nvrtc                11.8.89                       0    nvidia
cuda-nvtx                 11.8.86                       0    nvidia
cuda-runtime              11.8.0                        0    nvidia
cudatoolkit               11.8.0              h4ba93d1_13    conda-forge
cycler                    0.11.0             pyhd3eb1b0_0    defaults
dbus                      1.13.6               h5008d03_3    conda-forge
debugpy                   1.6.7           py310h6a678d5_0    defaults
decorator                 5.1.1              pyhd3eb1b0_0    defaults
eigen                     3.4.0                h00ab1b0_0    conda-forge
exceptiongroup            1.2.0           py310h06a4308_0    defaults
executing                 0.8.3              pyhd3eb1b0_0    defaults
expat                     2.6.2                h59595ed_0    conda-forge
ffmpeg                    4.3                  hf484d3e_0    pytorch
filelock                  3.13.1          py310h06a4308_0    defaults
flann                     1.9.2                h2b5ea80_0    conda-forge
font-ttf-dejavu-sans-mono 2.37                 hab24e00_0    conda-forge
font-ttf-inconsolata      3.000                h77eed37_0    conda-forge
font-ttf-source-code-pro  2.038                h77eed37_0    conda-forge
font-ttf-ubuntu           0.83                 h77eed37_1    conda-forge
fontconfig                2.14.2               h14ed4e7_0    conda-forge
fonts-conda-ecosystem     1                             0    conda-forge
fonts-conda-forge         1                             0    conda-forge
fonttools                 4.25.0             pyhd3eb1b0_0    defaults
freeimage                 3.18.0              h4b96d29_20    conda-forge
freetype                  2.12.1               h267a509_2    conda-forge
fsspec                    2024.3.1                 pypi_0    pypi
gdown                     5.1.0                    pypi_0    pypi
gettext                   0.21.1               h27087fc_0    conda-forge
gflags                    2.2.2             he1b5a44_1004    conda-forge
glew                      2.1.0                h9c3ff4c_2    conda-forge
glib                      2.80.0               hf2295e7_1    conda-forge
glib-tools                2.80.0               hde27a5a_1    conda-forge
glog                      0.6.0                h6f12383_0    conda-forge
gmp                       6.3.0                h59595ed_1    conda-forge
gmpy2                     2.1.2           py310heeb90bb_0    defaults
gnutls                    3.6.15               he1e5248_0    defaults
graphite2                 1.3.13            h58526e2_1001    conda-forge
gst-plugins-base          1.22.9               h8e1006c_0    conda-forge
gstreamer                 1.22.9               h98fc4e7_0    conda-forge
h5py                      3.10.0          nompi_py310h65828d5_101    conda-forge
harfbuzz                  8.3.0                h3d44ed6_0    conda-forge
hdf5                      1.14.3          nompi_h4f84152_100    conda-forge
hloc                      1.4                       dev_0    <develop>
icu                       73.2                 h59595ed_0    conda-forge
idna                      3.4             py310h06a4308_0    defaults
imath                     3.1.11               hfc55251_0    conda-forge
intel-openmp              2023.1.0         hdb19cb5_46306    defaults
ipykernel                 6.28.0          py310h06a4308_0    defaults
ipython                   8.20.0          py310h06a4308_0    defaults
jedi                      0.18.1          py310h06a4308_1    defaults
jinja2                    3.1.3           py310h06a4308_0    defaults
jupyter_client            8.6.0           py310h06a4308_0    defaults
jupyter_core              5.5.0           py310h06a4308_0    defaults
jxrlib                    1.1                  hd590300_3    conda-forge
keyutils                  1.6.1                h166bdaf_0    conda-forge
kiwisolver                1.4.4           py310h6a678d5_0    defaults
kornia                    0.7.2                    pypi_0    pypi
kornia-rs                 0.1.2                    pypi_0    pypi
krb5                      1.21.2               h659d440_0    conda-forge
lame                      3.100             h166bdaf_1003    conda-forge
lcms2                     2.16                 hb7c19ff_0    conda-forge
ld_impl_linux-64          2.38                 h1181459_1    https://repo.anaconda.com/pkgs/main
lerc                      4.0.0                h27087fc_0    conda-forge
libaec                    1.1.2                h59595ed_1    conda-forge
libblas                   3.9.0           1_h86c2bf4_netlib    conda-forge
libboost                  1.82.0               h6fcfa73_6    conda-forge
libbrotlicommon           1.0.9                h5eee18b_7    defaults
libbrotlidec              1.0.9                h5eee18b_7    defaults
libbrotlienc              1.0.9                h5eee18b_7    defaults
libcap                    2.69                 h0f662aa_0    conda-forge
libcblas                  3.9.0           5_h92ddd45_netlib    conda-forge
libclang                  15.0.7          default_hb11cfb5_4    conda-forge
libclang13                15.0.7          default_ha2b6cf4_4    conda-forge
libcublas                 11.11.3.6                     0    nvidia
libcufft                  10.9.0.58                     0    nvidia
libcufile                 1.9.0.20                      0    nvidia
libcups                   2.3.3                h4637d8d_4    conda-forge
libcurand                 10.3.5.119                    0    nvidia
libcurl                   8.6.0                hca28451_0    conda-forge
libcusolver               11.4.1.48                     0    nvidia
libcusparse               11.7.5.86                     0    nvidia
libdeflate                1.19                 hd590300_0    conda-forge
libedit                   3.1.20191231         he28a2e2_2    conda-forge
libev                     4.33                 hd590300_2    conda-forge
libevent                  2.1.12               hf998b51_1    conda-forge
libexpat                  2.6.2                h59595ed_0    conda-forge
libffi                    3.4.4                h6a678d5_0    https://repo.anaconda.com/pkgs/main
libflac                   1.4.3                h59595ed_0    conda-forge
libgcc-ng                 13.2.0               h807b86a_5    conda-forge
libgcrypt                 1.10.3               hd590300_0    conda-forge
libgfortran-ng            13.2.0               h69a702a_5    conda-forge
libgfortran5              13.2.0               ha4646dd_5    conda-forge
libglib                   2.80.0               hf2295e7_1    conda-forge
libglu                    9.0.0             hac7e632_1003    conda-forge
libgomp                   13.2.0               h807b86a_5    conda-forge
libgpg-error              1.48                 h71f35ed_0    conda-forge
libhwloc                  2.9.3           default_h554bfaf_1009    conda-forge
libiconv                  1.17                 hd590300_2    conda-forge
libidn2                   2.3.4                h5eee18b_0    defaults
libjpeg-turbo             3.0.0                hd590300_1    conda-forge
liblapack                 3.9.0           5_h92ddd45_netlib    conda-forge
libllvm15                 15.0.7               hb3ce162_4    conda-forge
libnghttp2                1.58.0               h47da74e_1    conda-forge
libnpp                    11.8.0.86                     0    nvidia
libnsl                    2.0.1                hd590300_0    conda-forge
libnvjpeg                 11.9.0.86                     0    nvidia
libogg                    1.3.4                h7f98852_1    conda-forge
libopenblas               0.3.26          pthreads_h413a1c8_0    conda-forge
libopus                   1.3.1                h7f98852_1    conda-forge
libpng                    1.6.43               h2797004_0    conda-forge
libpq                     16.2                 h33b98f1_1    conda-forge
libraw                    0.21.1               h2a13503_2    conda-forge
libsndfile                1.2.2                hc60ed4a_1    conda-forge
libsodium                 1.0.18               h7b6447c_0    defaults
libsqlite                 3.45.2               h2797004_0    conda-forge
libssh2                   1.11.0               h0841786_0    conda-forge
libstdcxx-ng              13.2.0               h7e041cc_5    conda-forge
libsystemd0               255                  h3516f8a_1    conda-forge
libtasn1                  4.19.0               h5eee18b_0    defaults
libtiff                   4.6.0                ha9c0a0a_2    conda-forge
libunistring              0.9.10               h27cfd23_0    defaults
libuuid                   2.38.1               h0b41bf4_0    conda-forge
libvorbis                 1.3.7                h9c3ff4c_0    conda-forge
libwebp-base              1.3.2                hd590300_0    conda-forge
libxcb                    1.15                 h0b41bf4_0    conda-forge
libxcrypt                 4.4.36               hd590300_1    conda-forge
libxkbcommon              1.6.0                hd429924_1    conda-forge
libxml2                   2.12.6               h232c23b_0    conda-forge
libzlib                   1.2.13               hd590300_5    conda-forge
lightglue                 0.0                      pypi_0    pypi
llvm-openmp               14.0.6               h9e868ea_0    defaults
lz4-c                     1.9.4                hcb278e6_0    conda-forge
markupsafe                2.1.3           py310h5eee18b_0    defaults
matplotlib                3.8.0           py310h06a4308_0    defaults
matplotlib-base           3.8.0           py310h1128e8f_0    defaults
matplotlib-inline         0.1.6           py310h06a4308_0    defaults
metis                     5.1.1                h59595ed_2    conda-forge
mkl                       2023.1.0         h213fc3f_46344    defaults
mkl-service               2.4.0           py310h5eee18b_1    defaults
mpc                       1.1.0                h10f8cd9_1    defaults
mpfr                      4.2.1                h9458935_0    conda-forge
mpg123                    1.32.4               h59595ed_0    conda-forge
mpmath                    1.3.0           py310h06a4308_0    defaults
munkres                   1.1.4                      py_0    defaults
mysql-common              8.0.33               hf1915f5_6    conda-forge
mysql-libs                8.0.33               hca2cd23_6    conda-forge
ncurses                   6.4                  h6a678d5_0    https://repo.anaconda.com/pkgs/main
nest-asyncio              1.6.0           py310h06a4308_0    defaults
nettle                    3.7.3                hbbd107a_1    defaults
networkx                  3.1             py310h06a4308_0    defaults
nspr                      4.35                 h27087fc_0    conda-forge
nss                       3.98                 h1d7d5a4_0    conda-forge
numpy                     1.26.4          py310hb13e2d6_0    conda-forge
omegaconf                 2.3.0              pyhd8ed1ab_0    conda-forge
opencv-python             4.9.0.80                 pypi_0    pypi
openexr                   3.2.2                haf962dd_1    conda-forge
openh264                  2.1.1                h4ff587b_0    defaults
openjpeg                  2.5.2                h488ebb8_0    conda-forge
openssl                   3.2.1                hd590300_1    conda-forge
packaging                 23.2            py310h06a4308_0    defaults
parso                     0.8.3              pyhd3eb1b0_0    defaults
pcre2                     10.43                hcad00b1_0    conda-forge
pexpect                   4.8.0              pyhd3eb1b0_3    defaults
pillow                    10.2.0          py310h01dd4db_0    conda-forge
pip                       23.3.1          py310h06a4308_0    https://repo.anaconda.com/pkgs/main
pixman                    0.43.2               h59595ed_0    conda-forge
pixsfm                    1.0.0                     dev_0    <develop>
platformdirs              3.10.0          py310h06a4308_0    defaults
plotly                    5.19.0          py310h2f386ee_0    defaults
ply                       3.11            py310h06a4308_0    defaults
prompt-toolkit            3.0.43          py310h06a4308_0    defaults
prompt_toolkit            3.0.43               hd3eb1b0_0    defaults
psutil                    5.9.0           py310h5eee18b_0    defaults
pthread-stubs             0.4               h36c2ea0_1001    conda-forge
ptyprocess                0.7.0              pyhd3eb1b0_2    defaults
pulseaudio-client         16.1                 hb77b528_5    conda-forge
pure_eval                 0.2.2              pyhd3eb1b0_0    defaults
pyceres                   2.1                      pypi_0    pypi
pycolmap                  0.4.0           cuda118py310h256e785_6    conda-forge
pygments                  2.15.1          py310h06a4308_1    defaults
pyparsing                 3.0.9           py310h06a4308_0    defaults
pyqt                      5.15.10         py310h6a678d5_0    defaults
pyqt5-sip                 12.13.0         py310h5eee18b_0    defaults
pysocks                   1.7.1           py310h06a4308_0    defaults
python                    3.10.13         hd12c33a_1_cpython    conda-forge
python-dateutil           2.8.2              pyhd3eb1b0_0    defaults
python_abi                3.10                    4_cp310    conda-forge
pytorch                   2.2.1           py3.10_cuda11.8_cudnn8.7.0_0    pytorch
pytorch-cuda              11.8                 h7e8668a_5    pytorch
pytorch-mutex             1.0                        cuda    pytorch
pyyaml                    6.0.1           py310h5eee18b_0    defaults
pyzmq                     25.1.2          py310h6a678d5_0    defaults
qt-main                   5.15.8              h5810be5_19    conda-forge
readline                  8.2                  h5eee18b_0    https://repo.anaconda.com/pkgs/main
requests                  2.31.0          py310h06a4308_1    defaults
scipy                     1.12.0          py310h5f9d8c6_0    defaults
setuptools                68.2.2          py310h06a4308_0    https://repo.anaconda.com/pkgs/main
sip                       6.7.12          py310h6a678d5_0    defaults
six                       1.16.0             pyhd3eb1b0_1    defaults
soupsieve                 2.5                      pypi_0    pypi
sqlite                    3.41.2               h5eee18b_0    https://repo.anaconda.com/pkgs/main
stack_data                0.2.0              pyhd3eb1b0_0    defaults
suitesparse               5.10.1               h3ec001c_2    conda-forge
sympy                     1.12            pypyh9d50eac_103    conda-forge
tbb                       2021.11.0            h00ab1b0_1    conda-forge
tenacity                  8.2.2           py310h06a4308_0    defaults
tk                        8.6.13          noxft_h4845f30_101    conda-forge
tomli                     2.0.1           py310h06a4308_0    defaults
torchaudio                2.2.1               py310_cu118    pytorch
torchtriton               2.2.0                     py310    pytorch
torchvision               0.17.1              py310_cu118    pytorch
tornado                   6.3.3           py310h5eee18b_0    defaults
tqdm                      4.66.2                   pypi_0    pypi
traitlets                 5.7.1           py310h06a4308_0    defaults
typing_extensions         4.9.0           py310h06a4308_1    defaults
tzdata                    2024a                h04d1e81_0    https://repo.anaconda.com/pkgs/main
urllib3                   2.1.0           py310h06a4308_1    defaults
vlfeat                    0.9.21               hd590300_1    conda-forge
wcwidth                   0.2.5              pyhd3eb1b0_0    defaults
wheel                     0.41.2          py310h06a4308_0    https://repo.anaconda.com/pkgs/main
xcb-util                  0.4.0                hd590300_1    conda-forge
xcb-util-image            0.4.0                h8ee46fc_1    conda-forge
xcb-util-keysyms          0.4.0                h8ee46fc_1    conda-forge
xcb-util-renderutil       0.3.9                hd590300_1    conda-forge
xcb-util-wm               0.4.1                h8ee46fc_1    conda-forge
xkeyboard-config          2.41                 hd590300_0    conda-forge
xorg-fixesproto           5.0               h7f98852_1002    conda-forge
xorg-kbproto              1.0.7             h7f98852_1002    conda-forge
xorg-libice               1.1.1                hd590300_0    conda-forge
xorg-libsm                1.2.4                h7391055_0    conda-forge
xorg-libx11               1.8.7                h8ee46fc_0    conda-forge
xorg-libxau               1.0.11               hd590300_0    conda-forge
xorg-libxdmcp             1.1.3                h7f98852_0    conda-forge
xorg-libxext              1.3.4                h0b41bf4_2    conda-forge
xorg-libxfixes            5.0.3             h7f98852_1004    conda-forge
xorg-libxrender           0.9.11               hd590300_0    conda-forge
xorg-renderproto          0.11.1            h7f98852_1002    conda-forge
xorg-xextproto            7.3.0             h0b41bf4_1003    conda-forge
xorg-xf86vidmodeproto     2.3.1             h7f98852_1002    conda-forge
xorg-xproto               7.0.31            h7f98852_1007    conda-forge
xz                        5.4.6                h5eee18b_0    https://repo.anaconda.com/pkgs/main
yaml                      0.2.5                h7b6447c_0    defaults
zeromq                    4.3.5                h6a678d5_0    defaults
zlib                      1.2.13               hd590300_5    conda-forge
zstd                      1.5.5                hfc55251_0    conda-forge

I tried adding [ -lboost_system ] into /pixel-perfect-sfm/pixsfm/CMakeLists.txt like this HOWEVER it didn't help :

add_library(pypixsfm ${PYPIXSFM_SOURCES})
target_link_libraries(pypixsfm PRIVATE pixsfm -lboost_system)

PIXSFM_ADD_PYMODULE(_pixsfm
    _pixsfm/bindings.cc
)
target_link_libraries(_pixsfm PRIVATE
 pypixsfm  ${PIXSFM_INTERNAL_LIBRARIES} ${PIXSFM_EXTERNAL_LIBRARIES} -lboost_system)

Could you plz help me with fixing that? Thanks.

empty-spacebar commented 8 months ago

Finally I found that it happens because I didn't build the requirements from the specified version of sources, and from pip(instead of conda).

The code is excellent , however building this project is such a nightmare :(