jkulhanek / tetra-nerf

Official implementation for Tetra-NeRF paper - NeRF represented as triangulation of input point cloud.
https://jkulhanek.com/tetra-nerf
MIT License
278 stars 14 forks source link

ModuleNotFoundError: No module named 'tetranerf' #18

Closed Mehi44 closed 1 year ago

Mehi44 commented 1 year ago

Hello! Thanks for the great work!

I have installed the package using pip and I got the following :

install

and when I check the site-packages of my environment I find that this :

site-packages

but when I try to run python -m tetranerf.scripts.process_images --path <data path> I get this error :

cmd

I have my data folder in this form :

data-folder

and system specifications are :

CUDA =11.3 PyTorch =1.12.1 Nerfstudio =0.2.2 OptiX = 7.5.0 CGAL = 5.5.2 (conda) CMake = 3.26.4

Is there something am missing here ?

jkulhanek commented 1 year ago

Hello, thanks!

Can you please give me the command you used to install tetranerf? Also, can you try manually cloning and running cmake . && make?

Mehi44 commented 1 year ago

The command I ran to install was :

pip install git+https://github.com/jkulhanek/tetra-nerf

I tried cloning and running cmake :

  -- The CUDA compiler identification is NVIDIA 11.3.58
  -- Detecting CXX compiler ABI info
  -- Detecting CXX compiler ABI info - done
  -- Check for working CXX compiler: /usr/bin/c++ - skipped
  -- Detecting CXX compile features
  -- Detecting CXX compile features - done
  -- Detecting CUDA compiler ABI info
  -- Detecting CUDA compiler ABI info - done
  -- Check for working CUDA compiler: /usr/local/cuda-11.3/bin/nvcc - skipped
  -- Detecting CUDA compile features
  -- Detecting CUDA compile features - done
  -- Using Python 3.9.17
  -- Found torch 1.12.1+cu113
  -- Using torch libraries: /home/mehi/anaconda3/envs/nerfstudio/lib/python3.9/site-packages/torch/lib
  -- Using torch includes: /home/mehi/anaconda3/envs/nerfstudio/lib/python3.9/site-packages/torch/include;/home/mehi/anaconda3/envs/nerfstudio/lib/python3.9/site-packages/torch/include/torch/csrc/api/include;/home/mehi/anaconda3/envs/nerfstudio/lib/python3.9/site-packages/torch/include/TH;/home/mehi/anaconda3/envs/nerfstudio/lib/python3.9/site-packages/torch/include/THC
  -- Using CUDA toolkit: /usr/local/cuda-11.3
  -- Using CUDA architectures: 80
  -- Using header-only CGAL
  -- Targetting Unix Makefiles
  -- Using /usr/bin/c++ compiler.
  -- Found GMP: /usr/lib/x86_64-linux-gnu/libgmp.so  
  -- Found MPFR: /usr/lib/x86_64-linux-gnu/libmpfr.so  
  -- Found Boost: /home/mehi/anaconda3/envs/nerfstudio/lib/cmake/Boost-1.78.0/BoostConfig.cmake (found suitable version "1.78.0", minimum required is "1.66")  
  -- Boost include dirs: /home/mehi/anaconda3/envs/nerfstudio/include
  -- Boost libraries:    
  -- Performing Test CMAKE_HAVE_LIBC_PTHREAD
  -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
  -- Check if compiler accepts -pthread
  -- Check if compiler accepts -pthread - yes
  -- Found Threads: TRUE  
  -- Using gcc version 4 or later. Adding -frounding-math
  [ 11%] Creating directories for 'pybind11-populate'
  [ 22%] Performing download step (git clone) for 'pybind11-populate'
  Cloning into 'pybind11-src'...
  fatal: detected dubious ownership in repository at '/nas1/mehi/tetranerf/tetra-nerf/_deps/pybind11-src'
  To add an exception for this directory, call:

          git config --global --add safe.directory /nas1/mehi/tetranerf/tetra-nerf/_deps/pybind11-src
  CMake Error at pybind11-subbuild/pybind11-populate-prefix/tmp/pybind11-populate-gitclone.cmake:49 (message):
    Failed to checkout tag: 'v2.9.2'

  make[2]: *** [CMakeFiles/pybind11-populate.dir/build.make:102: pybind11-populate-prefix/src/pybind11-populate-stamp/pybind11-populate-download] Error 1
  make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/pybind11-populate.dir/all] Error 2
  make: *** [Makefile:91: all] Error 2

  CMake Error at /home/mehi/anaconda3/envs/nerfstudio/lib/python3.9/site-packages/cmake/data/share/cmake-3.26/Modules/FetchContent.cmake:1622 (message):
    Build step for pybind11 failed: 2
  Call Stack (most recent call first):
    /home/mehi/anaconda3/envs/nerfstudio/lib/python3.9/site-packages/cmake/data/share/cmake-3.26/Modules/FetchContent.cmake:1762:EVAL:2 (__FetchContent_directPopulate)
    /home/mehi/anaconda3/envs/nerfstudio/lib/python3.9/site-packages/cmake/data/share/cmake-3.26/Modules/FetchContent.cmake:1762 (cmake_language)
    CMakeLists.txt:26 (FetchContent_Populate)

  -- Configuring incomplete, errors occurred!

also tried python setup.py install

/home/mehi/anaconda3/envs/nerfstudio/lib/python3.9/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.
!!

        ********************************************************************************
        Please avoid running ``setup.py`` directly.
        Instead, use pypa/build, pypa/installer, pypa/build or
        other standards-based tools.

        See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
        ********************************************************************************

!!
  self.initialize_options()
/home/mehi/anaconda3/envs/nerfstudio/lib/python3.9/site-packages/setuptools/_distutils/cmd.py:66: EasyInstallDeprecationWarning: easy_install command is deprecated.
!!

        ********************************************************************************
        Please avoid running ``setup.py`` and ``easy_install``.
        Instead, use pypa/build, pypa/installer, pypa/build or
        other standards-based tools.

        See https://github.com/pypa/setuptools/issues/917 for details.
        ********************************************************************************

!!
  self.initialize_options()
running bdist_egg
running egg_info
creating tetra_nerf.egg-info
writing tetra_nerf.egg-info/PKG-INFO
writing dependency_links to tetra_nerf.egg-info/dependency_links.txt
writing entry points to tetra_nerf.egg-info/entry_points.txt
writing requirements to tetra_nerf.egg-info/requires.txt
writing top-level names to tetra_nerf.egg-info/top_level.txt
writing manifest file 'tetra_nerf.egg-info/SOURCES.txt'
reading manifest file 'tetra_nerf.egg-info/SOURCES.txt'
adding license file 'LICENSE'
writing manifest file 'tetra_nerf.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_ext
-- Using torch libraries: /home/mehi/anaconda3/envs/nerfstudio/lib/python3.9/site-packages/torch/lib
-- Using torch includes: /home/mehi/anaconda3/envs/nerfstudio/lib/python3.9/site-packages/torch/include;/home/mehi/anaconda3/envs/nerfstudio/lib/python3.9/site-packages/torch/include/torch/csrc/api/include;/home/mehi/anaconda3/envs/nerfstudio/lib/python3.9/site-packages/torch/include/TH;/home/mehi/anaconda3/envs/nerfstudio/lib/python3.9/site-packages/torch/include/THC
-- Using CUDA toolkit: /usr/local/cuda-11.3
-- Using CUDA architectures: 80
-- Using header-only CGAL
-- Targetting Unix Makefiles
-- Using /usr/bin/c++ compiler.
-- Boost include dirs: /home/mehi/anaconda3/envs/nerfstudio/include
-- Boost libraries:    
-- Using gcc version 4 or later. Adding -frounding-math
[ 11%] Performing download step (git clone) for 'pybind11-populate'
Cloning into 'pybind11-src'...
fatal: detected dubious ownership in repository at '/nas1/mehi/tetranerf/tetra-nerf/_deps/pybind11-src'
To add an exception for this directory, call:

        git config --global --add safe.directory /nas1/mehi/tetranerf/tetra-nerf/_deps/pybind11-src
CMake Error at pybind11-subbuild/pybind11-populate-prefix/tmp/pybind11-populate-gitclone.cmake:49 (message):
  Failed to checkout tag: 'v2.9.2'

make[2]: *** [CMakeFiles/pybind11-populate.dir/build.make:102: pybind11-populate-prefix/src/pybind11-populate-stamp/pybind11-populate-download] Error 1
make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/pybind11-populate.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

CMake Error at /home/mehi/anaconda3/envs/nerfstudio/lib/python3.9/site-packages/cmake/data/share/cmake-3.26/Modules/FetchContent.cmake:1622 (message):
  Build step for pybind11 failed: 2
Call Stack (most recent call first):
  /home/mehi/anaconda3/envs/nerfstudio/lib/python3.9/site-packages/cmake/data/share/cmake-3.26/Modules/FetchContent.cmake:1762:EVAL:2 (__FetchContent_directPopulate)
  /home/mehi/anaconda3/envs/nerfstudio/lib/python3.9/site-packages/cmake/data/share/cmake-3.26/Modules/FetchContent.cmake:1762 (cmake_language)
  CMakeLists.txt:26 (FetchContent_Populate)

-- Configuring incomplete, errors occurred!
Traceback (most recent call last):
  File "/nas1/mehi/tetranerf/tetra-nerf/setup.py", line 122, in <module>
    setup(
  File "/home/mehi/anaconda3/envs/nerfstudio/lib/python3.9/site-packages/setuptools/__init__.py", line 107, in setup
    return distutils.core.setup(**attrs)
  File "/home/mehi/anaconda3/envs/nerfstudio/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 185, in setup
    return run_commands(dist)
  File "/home/mehi/anaconda3/envs/nerfstudio/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
    dist.run_commands()
  File "/home/mehi/anaconda3/envs/nerfstudio/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
    self.run_command(cmd)
  File "/home/mehi/anaconda3/envs/nerfstudio/lib/python3.9/site-packages/setuptools/dist.py", line 1244, in run_command
    super().run_command(command)
  File "/home/mehi/anaconda3/envs/nerfstudio/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
    cmd_obj.run()
  File "/home/mehi/anaconda3/envs/nerfstudio/lib/python3.9/site-packages/setuptools/command/install.py", line 80, in run
    self.do_egg_install()
  File "/home/mehi/anaconda3/envs/nerfstudio/lib/python3.9/site-packages/setuptools/command/install.py", line 129, in do_egg_install
    self.run_command('bdist_egg')
  File "/home/mehi/anaconda3/envs/nerfstudio/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
    self.distribution.run_command(command)
  File "/home/mehi/anaconda3/envs/nerfstudio/lib/python3.9/site-packages/setuptools/dist.py", line 1244, in run_command
    super().run_command(command)
  File "/home/mehi/anaconda3/envs/nerfstudio/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
    cmd_obj.run()
  File "/home/mehi/anaconda3/envs/nerfstudio/lib/python3.9/site-packages/setuptools/command/bdist_egg.py", line 164, in run
    cmd = self.call_command('install_lib', warn_dir=0)
  File "/home/mehi/anaconda3/envs/nerfstudio/lib/python3.9/site-packages/setuptools/command/bdist_egg.py", line 150, in call_command
    self.run_command(cmdname)
  File "/home/mehi/anaconda3/envs/nerfstudio/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
    self.distribution.run_command(command)
  File "/home/mehi/anaconda3/envs/nerfstudio/lib/python3.9/site-packages/setuptools/dist.py", line 1244, in run_command
    super().run_command(command)
  File "/home/mehi/anaconda3/envs/nerfstudio/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
    cmd_obj.run()
  File "/home/mehi/anaconda3/envs/nerfstudio/lib/python3.9/site-packages/setuptools/command/install_lib.py", line 11, in run
    self.build()
  File "/home/mehi/anaconda3/envs/nerfstudio/lib/python3.9/site-packages/setuptools/_distutils/command/install_lib.py", line 111, in build
    self.run_command('build_ext')
  File "/home/mehi/anaconda3/envs/nerfstudio/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
    self.distribution.run_command(command)
  File "/home/mehi/anaconda3/envs/nerfstudio/lib/python3.9/site-packages/setuptools/dist.py", line 1244, in run_command
    super().run_command(command)
  File "/home/mehi/anaconda3/envs/nerfstudio/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
    cmd_obj.run()
  File "/nas1/mehi/tetranerf/tetra-nerf/setup.py", line 63, in run
    self.build_extension(ext)
  File "/nas1/mehi/tetranerf/tetra-nerf/setup.py", line 107, in build_extension
    subprocess.run(["cmake", ext.sourcedir, *cmake_args], cwd=ext.sourcedir, check=True)
  File "/home/mehi/anaconda3/envs/nerfstudio/lib/python3.9/subprocess.py", line 528, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['cmake', '/nas1/mehi/tetranerf/tetra-nerf', '-DPYTHON_EXECUTABLE=/home/mehi/anaconda3/envs/nerfstudio/bin/python', '-DCMAKE_BUILD_TYPE=Release', '-DEXAMPLE_VERSION_INFO=0.1.1']' returned non-zero exit status 1.

Also checked these just to be sure ...

checks

jkulhanek commented 1 year ago

It seems like your git is complaining about cloning pybind. Can you try running the following: git config --global --add safe.directory /nas1/mehi/tetranerf/tetra-nerf/_deps/pybind11-src? ... and then run cmake . && make

Mehi44 commented 1 year ago

That worked thanks 👍