欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 科技 > 名人名企 > python编译遇坑总结

python编译遇坑总结

2025/4/4 6:33:27 来源:https://blog.csdn.net/wrk226/article/details/142022584  浏览:    关键词:python编译遇坑总结

gaussian-opacity-fields

问题:报错太长,无法定位到错误位置:

ninja: build stopped: subcommand failed.Traceback (most recent call last):File "D:\miniconda3\envs\gaussian_splatting\lib\site-packages\torch\utils\cpp_extension.py", line 1900, in _run_ninja_buildsubprocess.run(File "D:\miniconda3\envs\gaussian_splatting\lib\subprocess.py", line 528, in runraise 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 "<string>", line 2, in <module>File "<pip-setuptools-caller>", line 34, in <module>File "C:\Users\D-Blue\Desktop\cloth2\reference_model\gaussian-opacity-fields\submodules\diff-gaussian-rasterization\setup.py", line 17, in <module>setup(File "D:\miniconda3\envs\gaussian_splatting\lib\site-packages\setuptools\__init__.py", line 104, in setupreturn distutils.core.setup(**attrs)File "D:\miniconda3\envs\gaussian_splatting\lib\site-packages\setuptools\_distutils\core.py", line 184, in setupreturn run_commands(dist)File "D:\miniconda3\envs\gaussian_splatting\lib\site-packages\setuptools\_distutils\core.py", line 200, in run_commandsdist.run_commands()File "D:\miniconda3\envs\gaussian_splatting\lib\site-packages\setuptools\_distutils\dist.py", line 969, in run_commandsself.run_command(cmd)File "D:\miniconda3\envs\gaussian_splatting\lib\site-packages\setuptools\dist.py", line 967, in run_commandsuper().run_command(command)File "D:\miniconda3\envs\gaussian_splatting\lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_commandcmd_obj.run()File "D:\miniconda3\envs\gaussian_splatting\lib\site-packages\wheel\bdist_wheel.py", line 368, in runself.run_command("build")File "D:\miniconda3\envs\gaussian_splatting\lib\site-packages\setuptools\_distutils\cmd.py", line 316, in run_commandself.distribution.run_command(command)File "D:\miniconda3\envs\gaussian_splatting\lib\site-packages\setuptools\dist.py", line 967, in run_commandsuper().run_command(command)File "D:\miniconda3\envs\gaussian_splatting\lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_commandcmd_obj.run()File "D:\miniconda3\envs\gaussian_splatting\lib\site-packages\setuptools\_distutils\command\build.py", line 132, in runself.run_command(cmd_name)File "D:\miniconda3\envs\gaussian_splatting\lib\site-packages\setuptools\_distutils\cmd.py", line 316, in run_commandself.distribution.run_command(command)File "D:\miniconda3\envs\gaussian_splatting\lib\site-packages\setuptools\dist.py", line 967, in run_commandsuper().run_command(command)File "D:\miniconda3\envs\gaussian_splatting\lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_commandcmd_obj.run()File "D:\miniconda3\envs\gaussian_splatting\lib\site-packages\setuptools\command\build_ext.py", line 91, in run_build_ext.run(self)File "D:\miniconda3\envs\gaussian_splatting\lib\site-packages\setuptools\_distutils\command\build_ext.py", line 359, in runself.build_extensions()File "D:\miniconda3\envs\gaussian_splatting\lib\site-packages\torch\utils\cpp_extension.py", line 843, in build_extensionsbuild_ext.build_extensions(self)File "D:\miniconda3\envs\gaussian_splatting\lib\site-packages\setuptools\_distutils\command\build_ext.py", line 479, in build_extensionsself._build_extensions_serial()File "D:\miniconda3\envs\gaussian_splatting\lib\site-packages\setuptools\_distutils\command\build_ext.py", line 505, in _build_extensions_serialself.build_extension(ext)File "D:\miniconda3\envs\gaussian_splatting\lib\site-packages\setuptools\command\build_ext.py", line 252, in build_extension_build_ext.build_extension(self, ext)File "D:\miniconda3\envs\gaussian_splatting\lib\site-packages\setuptools\_distutils\command\build_ext.py", line 560, in build_extensionobjects = self.compiler.compile(File "D:\miniconda3\envs\gaussian_splatting\lib\site-packages\torch\utils\cpp_extension.py", line 815, in win_wrap_ninja_compile_write_ninja_file_and_compile_objects(File "D:\miniconda3\envs\gaussian_splatting\lib\site-packages\torch\utils\cpp_extension.py", line 1573, in _write_ninja_file_and_compile_objects_run_ninja_build(File "D:\miniconda3\envs\gaussian_splatting\lib\site-packages\torch\utils\cpp_extension.py", line 1916, in _run_ninja_buildraise RuntimeError(message) from eRuntimeError: Error compiling objects for extension

解决方案:python setup.py build_ext --inplace -j1

原因:这样可以取消并行编译,更容易获得报错信息。

=================================================

问题:

C:\Users\D-Blue\Desktop\cloth2\reference_model\gaussian-opacity-fields\submodules\diff-gaussian-rasterization\cuda_rasterizer\forward.cu(983): error: identifier "u_int16_t" is undefineddetected during instantiation of "void integrateCUDA<CHANNELS>(const uint2 *, const uint2 *, const uint32_t *, const uint32_t *, int, int, float, float, const float2 *, const float2 *, const float *, const float *, const float *, const float *, const float3 *, const float3 *, const float *, const float4 *, float *, uint32_t *, const float *, float *, float *, float *) [with CHANNELS=3U]"
(1247): hereC:\Users\D-Blue\Desktop\cloth2\reference_model\gaussian-opacity-fields\submodules\diff-gaussian-rasterization\cuda_rasterizer\forward.cu(983): error: expected a ";"detected during instantiation of "void integrateCUDA<CHANNELS>(const uint2 *, const uint2 *, const uint32_t *, const uint32_t *, int, int, float, float, const float2 *, const float2 *, const float *, const float *, const float *, const float *, const float3 *, const float3 *, const float *, const float4 *, float *, uint32_t *, const float *, float *, float *, float *) [with CHANNELS=3U]"
(1247): hereC:\Users\D-Blue\Desktop\cloth2\reference_model\gaussian-opacity-fields\submodules\diff-gaussian-rasterization\cuda_rasterizer\forward.cu(1145): error: identifier "u_int32_t" is undefineddetected during instantiation of "void integrateCUDA<CHANNELS>(const uint2 *, const uint2 *, const uint32_t *, const uint32_t *, int, int, float, float, const float2 *, const float2 *, const float *, const float *, const float *, const float *, const float3 *, const float3 *, const float *, const float4 *, float *, uint32_t *, const float *, float *, float *, float *) [with CHANNELS=3U]"
(1247): hereC:\Users\D-Blue\Desktop\cloth2\reference_model\gaussian-opacity-fields\submodules\diff-gaussian-rasterization\cuda_rasterizer\forward.cu(1145): error: expected a ")"detected during instantiation of "void integrateCUDA<CHANNELS>(const uint2 *, const uint2 *, const uint32_t *, const uint32_t *, int, int, float, float, const float2 *, const float2 *, const float *, const float *, const float *, const float *, const float3 *, const float3 *, const float *, const float4 *, float *, uint32_t *, const float *, float *, float *, float *) [with CHANNELS=3U]"
(1247): hereC:\Users\D-Blue\Desktop\cloth2\reference_model\gaussian-opacity-fields\submodules\diff-gaussian-rasterization\cuda_rasterizer\forward.cu(1158): warning #2361-D: invalid narrowing conversion from "double" to "float"detected during instantiation of "void integrateCUDA<CHANNELS>(const uint2 *, const uint2 *, const uint32_t *, const uint32_t *, int, int, float, float, const float2 *, const float2 *, const float *, const float *, const float *, const float *, const float3 *, const float3 *, const float *, const float4 *, float *, uint32_t *, const float *, float *, float *, float *) [with CHANNELS=3U]"
(1247): hereC:\Users\D-Blue\Desktop\cloth2\reference_model\gaussian-opacity-fields\submodules\diff-gaussian-rasterization\cuda_rasterizer\forward.cu(1158): warning #2361-D: invalid narrowing conversion from "double" to "float"detected during instantiation of "void integrateCUDA<CHANNELS>(const uint2 *, const uint2 *, const uint32_t *, const uint32_t *, int, int, float, float, const float2 *, const float2 *, const float *, const float *, const float *, const float *, const float3 *, const float3 *, const float *, const float4 *, float *, uint32_t *, const float *, float *, float *, float *) [with CHANNELS=3U]"
(1247): hereC:\Users\D-Blue\Desktop\cloth2\reference_model\gaussian-opacity-fields\submodules\diff-gaussian-rasterization\cuda_rasterizer\forward.cu(845): warning #177-D: variable "depth_input" was declared but never referenceddetected during instantiation of "void integrateCUDA<CHANNELS>(const uint2 *, const uint2 *, const uint32_t *, const uint32_t *, int, int, float, float, const float2 *, const float2 *, const float *, const float *, const float *, const float *, const float3 *, const float3 *, const float *, const float4 *, float *, uint32_t *, const float *, float *, float *, float *) [with CHANNELS=3U]"
(1247): hereC:\Users\D-Blue\Desktop\cloth2\reference_model\gaussian-opacity-fields\submodules\diff-gaussian-rasterization\cuda_rasterizer\forward.cu(848): warning #177-D: variable "ray" was declared but never referenceddetected during instantiation of "void integrateCUDA<CHANNELS>(const uint2 *, const uint2 *, const uint32_t *, const uint32_t *, int, int, float, float, const float2 *, const float2 *, const float *, const float *, const float *, const float *, const float3 *, const float3 *, const float *, const float4 *, float *, uint32_t *, const float *, float *, float *, float *) [with CHANNELS=3U]"
(1247): hereC:\Users\D-Blue\Desktop\cloth2\reference_model\gaussian-opacity-fields\submodules\diff-gaussian-rasterization\cuda_rasterizer\forward.cu(873): warning #177-D: variable "T" was declared but never referenceddetected during instantiation of "void integrateCUDA<CHANNELS>(const uint2 *, const uint2 *, const uint32_t *, const uint32_t *, int, int, float, float, const float2 *, const float2 *, const float *, const float *, const float *, const float *, const float3 *, const float3 *, const float *, const float4 *, float *, uint32_t *, const float *, float *, float *, float *) [with CHANNELS=3U]"
(1247): hereC:\Users\D-Blue\Desktop\cloth2\reference_model\gaussian-opacity-fields\submodules\diff-gaussian-rasterization\cuda_rasterizer\forward.cu(879): warning #550-D: variable "contributed_ids" was set but never useddetected during instantiation of "void integrateCUDA<CHANNELS>(const uint2 *, const uint2 *, const uint32_t *, const uint32_t *, int, int, float, float, const float2 *, const float2 *, const float *, const float *, const float *, const float *, const float3 *, const float3 *, const float *, const float4 *, float *, uint32_t *, const float *, float *, float *, float *) [with CHANNELS=3U]"
(1247): here4 errors detected in the compilation of "C:/Users/D-Blue/Desktop/cloth2/reference_model/gaussian-opacity-fields/submodules/diff-gaussian-rasterization/cuda_rasterizer/forward.cu".
forward.cu
ninja: build stopped: subcommand failed.
Traceback (most recent call last):File "D:\miniconda3\envs\gaussian_splatting\lib\site-packages\torch\utils\cpp_extension.py", line 1900, in _run_ninja_buildsubprocess.run(File "D:\miniconda3\envs\gaussian_splatting\lib\subprocess.py", line 528, in runraise 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 "C:\Users\D-Blue\Desktop\cloth2\reference_model\gaussian-opacity-fields\submodules\diff-gaussian-rasterization\setup.py", line 17, in <module>setup(File "D:\miniconda3\envs\gaussian_splatting\lib\site-packages\setuptools\__init__.py", line 104, in setupreturn distutils.core.setup(**attrs)File "D:\miniconda3\envs\gaussian_splatting\lib\site-packages\setuptools\_distutils\core.py", line 184, in setupreturn run_commands(dist)File "D:\miniconda3\envs\gaussian_splatting\lib\site-packages\setuptools\_distutils\core.py", line 200, in run_commandsdist.run_commands()File "D:\miniconda3\envs\gaussian_splatting\lib\site-packages\setuptools\_distutils\dist.py", line 969, in run_commandsself.run_command(cmd)File "D:\miniconda3\envs\gaussian_splatting\lib\site-packages\setuptools\dist.py", line 967, in run_commandsuper().run_command(command)File "D:\miniconda3\envs\gaussian_splatting\lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_commandcmd_obj.run()File "D:\miniconda3\envs\gaussian_splatting\lib\site-packages\setuptools\command\build_ext.py", line 91, in run_build_ext.run(self)File "D:\miniconda3\envs\gaussian_splatting\lib\site-packages\setuptools\_distutils\command\build_ext.py", line 359, in runself.build_extensions()File "D:\miniconda3\envs\gaussian_splatting\lib\site-packages\torch\utils\cpp_extension.py", line 843, in build_extensionsbuild_ext.build_extensions(self)File "D:\miniconda3\envs\gaussian_splatting\lib\site-packages\setuptools\_distutils\command\build_ext.py", line 477, in build_extensionsself._build_extensions_parallel()File "D:\miniconda3\envs\gaussian_splatting\lib\site-packages\setuptools\_distutils\command\build_ext.py", line 500, in _build_extensions_parallelfut.result()File "D:\miniconda3\envs\gaussian_splatting\lib\concurrent\futures\_base.py", line 446, in resultreturn self.__get_result()File "D:\miniconda3\envs\gaussian_splatting\lib\concurrent\futures\_base.py", line 391, in __get_resultraise self._exceptionFile "D:\miniconda3\envs\gaussian_splatting\lib\concurrent\futures\thread.py", line 58, in runresult = self.fn(*self.args, **self.kwargs)File "D:\miniconda3\envs\gaussian_splatting\lib\site-packages\setuptools\command\build_ext.py", line 252, in build_extension_build_ext.build_extension(self, ext)File "D:\miniconda3\envs\gaussian_splatting\lib\site-packages\setuptools\_distutils\command\build_ext.py", line 560, in build_extensionobjects = self.compiler.compile(File "D:\miniconda3\envs\gaussian_splatting\lib\site-packages\torch\utils\cpp_extension.py", line 815, in win_wrap_ninja_compile_write_ninja_file_and_compile_objects(File "D:\miniconda3\envs\gaussian_splatting\lib\site-packages\torch\utils\cpp_extension.py", line 1573, in _write_ninja_file_and_compile_objects_run_ninja_build(File "D:\miniconda3\envs\gaussian_splatting\lib\site-packages\torch\utils\cpp_extension.py", line 1916, in _run_ninja_buildraise RuntimeError(message) from e
RuntimeError: Error compiling objects for extension

解决方案:替换所有的 u_int16_t 和 u_int32_t 为标准的 uint16_t 和 uint32_t。

原因:u_int16_t 和 u_int32_t 是 Linux/Unix 系统中常用的类型定义,但在 Windows 系统中通常不支持。

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

热搜词