liang3588 / MeshMAE

MeshMAE: Masked Autoencoders for 3D Mesh Data Analysis
41 stars 8 forks source link

No module named "chamfer" #8

Open Arandinglv opened 2 months ago

Arandinglv commented 2 months ago

I saw chamfer_dist folder, and python setup.py --user reported errors:

running install
/home/yutianjiang/.conda/envs/python39/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 or other
        standards-based tools.

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

!!
  self.initialize_options()
/home/yutianjiang/.conda/envs/python39/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 or other
        standards-based tools.

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

!!
  self.initialize_options()
running bdist_egg
running egg_info
writing chamfer.egg-info/PKG-INFO
writing dependency_links to chamfer.egg-info/dependency_links.txt
writing top-level names to chamfer.egg-info/top_level.txt
reading manifest file 'chamfer.egg-info/SOURCES.txt'
writing manifest file 'chamfer.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_ext
building 'chamfer' extension
Emitting ninja build file /home/yutianjiang/20240918-urban/MeshMAE-mesh/chamfer_dist/build/temp.linux-x86_64-cpython-39/build.ninja...
Compiling objects...
Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N)
[1/2] c++ -MMD -MF /home/yutianjiang/20240918-urban/MeshMAE-mesh/chamfer_dist/build/temp.linux-x86_64-cpython-39/chamfer_cuda.o.d -pthread -B /home/yutianjiang/.conda/envs/python39/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -Wall -fPIC -O2 -isystem /home/yutianjiang/.conda/envs/python39/include -I/home/yutianjiang/.conda/envs/python39/include -fPIC -O2 -isystem /home/yutianjiang/.conda/envs/python39/include -fPIC -I/home/yutianjiang/.conda/envs/python39/lib/python3.9/site-packages/torch/include -I/home/yutianjiang/.conda/envs/python39/lib/python3.9/site-packages/torch/include/torch/csrc/api/include -I/home/yutianjiang/.conda/envs/python39/lib/python3.9/site-packages/torch/include/TH -I/home/yutianjiang/.conda/envs/python39/lib/python3.9/site-packages/torch/include/THC -I/home/yutianjiang/.conda/envs/python39/include/python3.9 -c -c /home/yutianjiang/20240918-urban/MeshMAE-mesh/chamfer_dist/chamfer_cuda.cpp -o /home/yutianjiang/20240918-urban/MeshMAE-mesh/chamfer_dist/build/temp.linux-x86_64-cpython-39/chamfer_cuda.o -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=chamfer -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++14
In file included from /home/yutianjiang/.conda/envs/python39/lib/python3.9/site-packages/torch/include/ATen/Parallel.h:140,
                 from /home/yutianjiang/.conda/envs/python39/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/utils.h:3,
                 from /home/yutianjiang/.conda/envs/python39/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:5,
                 from /home/yutianjiang/.conda/envs/python39/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn.h:3,
                 from /home/yutianjiang/.conda/envs/python39/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/all.h:13,
                 from /home/yutianjiang/.conda/envs/python39/lib/python3.9/site-packages/torch/include/torch/extension.h:4,
                 from /home/yutianjiang/20240918-urban/MeshMAE-mesh/chamfer_dist/chamfer_cuda.cpp:9:
/home/yutianjiang/.conda/envs/python39/lib/python3.9/site-packages/torch/include/ATen/ParallelOpenMP.h:87: warning: ignoring ‘#pragma omp parallel’ [-Wunknown-pragmas]
   87 | #pragma omp parallel for if ((end - begin) >= grain_size)
      | 
[2/2] /usr/bin/nvcc  -I/home/yutianjiang/.conda/envs/python39/lib/python3.9/site-packages/torch/include -I/home/yutianjiang/.conda/envs/python39/lib/python3.9/site-packages/torch/include/torch/csrc/api/include -I/home/yutianjiang/.conda/envs/python39/lib/python3.9/site-packages/torch/include/TH -I/home/yutianjiang/.conda/envs/python39/lib/python3.9/site-packages/torch/include/THC -I/home/yutianjiang/.conda/envs/python39/include/python3.9 -c -c /home/yutianjiang/20240918-urban/MeshMAE-mesh/chamfer_dist/chamfer.cu -o /home/yutianjiang/20240918-urban/MeshMAE-mesh/chamfer_dist/build/temp.linux-x86_64-cpython-39/chamfer.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options ''"'"'-fPIC'"'"'' -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=chamfer -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_86,code=compute_86 -gencode=arch=compute_86,code=sm_86 -std=c++14
FAILED: /home/yutianjiang/20240918-urban/MeshMAE-mesh/chamfer_dist/build/temp.linux-x86_64-cpython-39/chamfer.o 
/usr/bin/nvcc  -I/home/yutianjiang/.conda/envs/python39/lib/python3.9/site-packages/torch/include -I/home/yutianjiang/.conda/envs/python39/lib/python3.9/site-packages/torch/include/torch/csrc/api/include -I/home/yutianjiang/.conda/envs/python39/lib/python3.9/site-packages/torch/include/TH -I/home/yutianjiang/.conda/envs/python39/lib/python3.9/site-packages/torch/include/THC -I/home/yutianjiang/.conda/envs/python39/include/python3.9 -c -c /home/yutianjiang/20240918-urban/MeshMAE-mesh/chamfer_dist/chamfer.cu -o /home/yutianjiang/20240918-urban/MeshMAE-mesh/chamfer_dist/build/temp.linux-x86_64-cpython-39/chamfer.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options ''"'"'-fPIC'"'"'' -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=chamfer -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_86,code=compute_86 -gencode=arch=compute_86,code=sm_86 -std=c++14
/home/yutianjiang/.conda/envs/python39/lib/python3.9/site-packages/torch/include/ATen/core/builtin_function.h(110): warning #20236-D: pragma "diag_suppress" is deprecated, use "nv_diag_suppress" instead

/home/yutianjiang/.conda/envs/python39/lib/python3.9/site-packages/torch/include/ATen/core/builtin_function.h(117): warning #20236-D: pragma "diag_default" is deprecated, use "nv_diag_default" instead

/home/yutianjiang/.conda/envs/python39/lib/python3.9/site-packages/torch/include/ATen/core/builtin_function.h(110): warning #20236-D: pragma "diag_suppress" is deprecated, use "nv_diag_suppress" instead

/home/yutianjiang/.conda/envs/python39/lib/python3.9/site-packages/torch/include/ATen/core/builtin_function.h(117): warning #20236-D: pragma "diag_default" is deprecated, use "nv_diag_default" instead

/home/yutianjiang/.conda/envs/python39/lib/python3.9/site-packages/torch/include/ATen/core/builtin_function.h(110): warning #20236-D: pragma "diag_suppress" is deprecated, use "nv_diag_suppress" instead

/home/yutianjiang/.conda/envs/python39/lib/python3.9/site-packages/torch/include/ATen/core/builtin_function.h(117): warning #20236-D: pragma "diag_default" is deprecated, use "nv_diag_default" instead

/home/yutianjiang/.conda/envs/python39/lib/python3.9/site-packages/torch/include/ATen/core/builtin_function.h(110): warning #20236-D: pragma "diag_suppress" is deprecated, use "nv_diag_suppress" instead

/home/yutianjiang/.conda/envs/python39/lib/python3.9/site-packages/torch/include/ATen/core/builtin_function.h(117): warning #20236-D: pragma "diag_default" is deprecated, use "nv_diag_default" instead

/usr/include/c++/11/bits/std_function.h:435:145: error: parameter packs not expanded with ‘...’:
  435 |         function(_Functor&& __f)
      |                                                                                                                                                 ^ 
/usr/include/c++/11/bits/std_function.h:435:145: note:         ‘_ArgTypes’
/usr/include/c++/11/bits/std_function.h:530:146: error: parameter packs not expanded with ‘...’:
  530 |         operator=(_Functor&& __f)
      |                                                                                                                                                  ^ 
/usr/include/c++/11/bits/std_function.h:530:146: note:         ‘_ArgTypes’
ninja: build stopped: subcommand failed.
Traceback (most recent call last):
  File "/home/yutianjiang/.conda/envs/python39/lib/python3.9/site-packages/torch/utils/cpp_extension.py", line 1666, in _run_ninja_build
    subprocess.run(
  File "/home/yutianjiang/.conda/envs/python39/lib/python3.9/subprocess.py", line 528, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['ninja', '-v']' returned non-zero exit status 1.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/yutianjiang/20240918-urban/MeshMAE-mesh/chamfer_dist/setup.py", line 11, in <module>
    setup(name='chamfer',
  File "/home/yutianjiang/.conda/envs/python39/lib/python3.9/site-packages/setuptools/__init__.py", line 117, in setup
    return distutils.core.setup(**attrs)
  File "/home/yutianjiang/.conda/envs/python39/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 183, in setup
    return run_commands(dist)
  File "/home/yutianjiang/.conda/envs/python39/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 199, in run_commands
    dist.run_commands()
  File "/home/yutianjiang/.conda/envs/python39/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 954, in run_commands
    self.run_command(cmd)
  File "/home/yutianjiang/.conda/envs/python39/lib/python3.9/site-packages/setuptools/dist.py", line 950, in run_command
    super().run_command(command)
  File "/home/yutianjiang/.conda/envs/python39/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 973, in run_command
    cmd_obj.run()
  File "/home/yutianjiang/.conda/envs/python39/lib/python3.9/site-packages/setuptools/command/install.py", line 97, in run
    self.do_egg_install()
  File "/home/yutianjiang/.conda/envs/python39/lib/python3.9/site-packages/setuptools/command/install.py", line 149, in do_egg_install
    self.run_command('bdist_egg')
  File "/home/yutianjiang/.conda/envs/python39/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 316, in run_command
    self.distribution.run_command(command)
  File "/home/yutianjiang/.conda/envs/python39/lib/python3.9/site-packages/setuptools/dist.py", line 950, in run_command
    super().run_command(command)
  File "/home/yutianjiang/.conda/envs/python39/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 973, in run_command
    cmd_obj.run()
  File "/home/yutianjiang/.conda/envs/python39/lib/python3.9/site-packages/setuptools/command/bdist_egg.py", line 168, in run
    cmd = self.call_command('install_lib', warn_dir=False)
  File "/home/yutianjiang/.conda/envs/python39/lib/python3.9/site-packages/setuptools/command/bdist_egg.py", line 154, in call_command
    self.run_command(cmdname)
  File "/home/yutianjiang/.conda/envs/python39/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 316, in run_command
    self.distribution.run_command(command)
  File "/home/yutianjiang/.conda/envs/python39/lib/python3.9/site-packages/setuptools/dist.py", line 950, in run_command
    super().run_command(command)
  File "/home/yutianjiang/.conda/envs/python39/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 973, in run_command
    cmd_obj.run()
  File "/home/yutianjiang/.conda/envs/python39/lib/python3.9/site-packages/setuptools/command/install_lib.py", line 19, in run
    self.build()
  File "/home/yutianjiang/.conda/envs/python39/lib/python3.9/site-packages/setuptools/_distutils/command/install_lib.py", line 110, in build
    self.run_command('build_ext')
  File "/home/yutianjiang/.conda/envs/python39/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 316, in run_command
    self.distribution.run_command(command)
  File "/home/yutianjiang/.conda/envs/python39/lib/python3.9/site-packages/setuptools/dist.py", line 950, in run_command
    super().run_command(command)
  File "/home/yutianjiang/.conda/envs/python39/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 973, in run_command
    cmd_obj.run()
  File "/home/yutianjiang/.conda/envs/python39/lib/python3.9/site-packages/setuptools/command/build_ext.py", line 98, in run
    _build_ext.run(self)
  File "/home/yutianjiang/.conda/envs/python39/lib/python3.9/site-packages/setuptools/_distutils/command/build_ext.py", line 359, in run
    self.build_extensions()
  File "/home/yutianjiang/.conda/envs/python39/lib/python3.9/site-packages/torch/utils/cpp_extension.py", line 709, in build_extensions
    build_ext.build_extensions(self)
  File "/home/yutianjiang/.conda/envs/python39/lib/python3.9/site-packages/setuptools/_distutils/command/build_ext.py", line 476, in build_extensions
    self._build_extensions_serial()
  File "/home/yutianjiang/.conda/envs/python39/lib/python3.9/site-packages/setuptools/_distutils/command/build_ext.py", line 502, in _build_extensions_serial
    self.build_extension(ext)
  File "/home/yutianjiang/.conda/envs/python39/lib/python3.9/site-packages/setuptools/command/build_ext.py", line 263, in build_extension
    _build_ext.build_extension(self, ext)
  File "/home/yutianjiang/.conda/envs/python39/lib/python3.9/site-packages/setuptools/_distutils/command/build_ext.py", line 557, in build_extension
    objects = self.compiler.compile(
  File "/home/yutianjiang/.conda/envs/python39/lib/python3.9/site-packages/torch/utils/cpp_extension.py", line 530, in unix_wrap_ninja_compile
    _write_ninja_file_and_compile_objects(
  File "/home/yutianjiang/.conda/envs/python39/lib/python3.9/site-packages/torch/utils/cpp_extension.py", line 1355, in _write_ninja_file_and_compile_objects
    _run_ninja_build(
  File "/home/yutianjiang/.conda/envs/python39/lib/python3.9/site-packages/torch/utils/cpp_extension.py", line 1682, in _run_ninja_build
    raise RuntimeError(message) from e
RuntimeError: Error compiling objects for extension

Could you please tell me how to import chamfer?

liang3588 commented 2 months ago

I'm sorry that I didn't encounter this issue. After searching online, I found that one possible reason is that the installed Pytorch and CUDA versions do not match.