OOTDiffusion icon indicating copy to clipboard operation
OOTDiffusion copied to clipboard

关于运行run/gradio_ootd.py 后出现ninja包的报错

Open dkw-wkd opened this issue 1 year ago • 7 comments

cuda 11.7 pytorch 2.0.1 ninja 1.10.2 运行出现以下错误,搜了些资料,感觉还是环境或者gcc依赖包啥的安装有问题,有大佬遇到这种情况解决了吗?

Traceback (most recent call last): File "/home/pc/.local/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 1893, in _run_ninja_build subprocess.run( File "/home/pc/anaconda3/envs/ootd/lib/python3.10/subprocess.py", line 524, 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/pc/dkw/OOTDiffusion/run/gradio_ootd.py", line 15, in from preprocess.humanparsing.aigc_run_parsing import Parsing File "/home/pc/dkw/OOTDiffusion/preprocess/humanparsing/aigc_run_parsing.py", line 7, in from parsing_api import load_atr_model, load_lip_model, inference File "/home/pc/dkw/OOTDiffusion/preprocess/humanparsing/parsing_api.py", line 11, in import networks File "/home/pc/dkw/OOTDiffusion/preprocess/humanparsing/networks/init.py", line 2, in from networks.AugmentCE2P import resnet101 File "/home/pc/dkw/OOTDiffusion/preprocess/humanparsing/networks/AugmentCE2P.py", line 22, in from modules import InPlaceABNSync File "/home/pc/dkw/OOTDiffusion/preprocess/humanparsing/modules/init.py", line 1, in from .bn import ABN, InPlaceABN, InPlaceABNSync File "/home/pc/dkw/OOTDiffusion/preprocess/humanparsing/modules/bn.py", line 10, in from .functions import * File "/home/pc/dkw/OOTDiffusion/preprocess/humanparsing/modules/functions.py", line 11, in backend = load(name="inplace_abn", File "/home/pc/.local/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 1284, in load return jit_compile( File "/home/pc/.local/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 1509, in jit_compile write_ninja_file_and_build_library( File "/home/pc/.local/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 1624, in write_ninja_file_and_build_library run_ninja_build( File "/home/pc/.local/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 1909, in run_ninja_build raise RuntimeError(message) from e RuntimeError: Error building extension 'inplace_abn': [1/3] /usr/bin/nvcc -DTORCH_EXTENSION_NAME=inplace_abn -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE="gcc" -DPYBIND11_STDLIB="libstdcpp" -DPYBIND11_BUILD_ABI="cxxabi1011" -isystem /home/pc/.local/lib/python3.10/site-packages/torch/include -isystem /home/pc/.local/lib/python3.10/site-packages/torch/include/torch/csrc/api/include -isystem /home/pc/.local/lib/python3.10/site-packages/torch/include/TH -isystem /home/pc/.local/lib/python3.10/site-packages/torch/include/THC -isystem /home/pc/anaconda3/envs/ootd/include/python3.10 -D_GLIBCXX_USE_CXX11_ABI=0 -D__CUDA_NO_HALF_OPERATORS -D__CUDA_NO_HALF_CONVERSIONS -D__CUDA_NO_BFLOAT16_CONVERSIONS -D__CUDA_NO_HALF2_OPERATORS --expt-relaxed-constexpr -gencode=arch=compute_70,code=compute_70 -gencode=arch=compute_70,code=sm_70 --compiler-options '-fPIC' --expt-extended-lambda -std=c++17 -c /home/pc/dkw/OOTDiffusion/preprocess/humanparsing/modules/src/inplace_abn_cuda_half.cu -o inplace_abn_cuda_half.cuda.o FAILED: inplace_abn_cuda_half.cuda.o /usr/bin/nvcc -DTORCH_EXTENSION_NAME=inplace_abn -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE="gcc" -DPYBIND11_STDLIB="libstdcpp" -DPYBIND11_BUILD_ABI="cxxabi1011" -isystem /home/pc/.local/lib/python3.10/site-packages/torch/include -isystem /home/pc/.local/lib/python3.10/site-packages/torch/include/torch/csrc/api/include -isystem /home/pc/.local/lib/python3.10/site-packages/torch/include/TH -isystem /home/pc/.local/lib/python3.10/site-packages/torch/include/THC -isystem /home/pc/anaconda3/envs/ootd/include/python3.10 -D_GLIBCXX_USE_CXX11_ABI=0 -D__CUDA_NO_HALF_OPERATORS -D__CUDA_NO_HALF_CONVERSIONS -D__CUDA_NO_BFLOAT16_CONVERSIONS_ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr -gencode=arch=compute_70,code=compute_70 -gencode=arch=compute_70,code=sm_70 --compiler-options '-fPIC' --expt-extended-lambda -std=c++17 -c /home/pc/dkw/OOTDiffusion/preprocess/humanparsing/modules/src/inplace_abn_cuda_half.cu -o inplace_abn_cuda_half.cuda.o /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’ [2/3] /usr/bin/nvcc -DTORCH_EXTENSION_NAME=inplace_abn -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE="gcc" -DPYBIND11_STDLIB="libstdcpp" -DPYBIND11_BUILD_ABI="cxxabi1011" -isystem /home/pc/.local/lib/python3.10/site-packages/torch/include -isystem /home/pc/.local/lib/python3.10/site-packages/torch/include/torch/csrc/api/include -isystem /home/pc/.local/lib/python3.10/site-packages/torch/include/TH -isystem /home/pc/.local/lib/python3.10/site-packages/torch/include/THC -isystem /home/pc/anaconda3/envs/ootd/include/python3.10 -D_GLIBCXX_USE_CXX11_ABI=0 -D__CUDA_NO_HALF_OPERATORS -D__CUDA_NO_HALF_CONVERSIONS -D__CUDA_NO_BFLOAT16_CONVERSIONS -D__CUDA_NO_HALF2_OPERATORS --expt-relaxed-constexpr -gencode=arch=compute_70,code=compute_70 -gencode=arch=compute_70,code=sm_70 --compiler-options '-fPIC' --expt-extended-lambda -std=c++17 -c /home/pc/dkw/OOTDiffusion/preprocess/humanparsing/modules/src/inplace_abn_cuda.cu -o inplace_abn_cuda.cuda.o FAILED: inplace_abn_cuda.cuda.o /usr/bin/nvcc -DTORCH_EXTENSION_NAME=inplace_abn -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE="gcc" -DPYBIND11_STDLIB="libstdcpp" -DPYBIND11_BUILD_ABI="cxxabi1011" -isystem /home/pc/.local/lib/python3.10/site-packages/torch/include -isystem /home/pc/.local/lib/python3.10/site-packages/torch/include/torch/csrc/api/include -isystem /home/pc/.local/lib/python3.10/site-packages/torch/include/TH -isystem /home/pc/.local/lib/python3.10/site-packages/torch/include/THC -isystem /home/pc/anaconda3/envs/ootd/include/python3.10 -D_GLIBCXX_USE_CXX11_ABI=0 -D__CUDA_NO_HALF_OPERATORS -D__CUDA_NO_HALF_CONVERSIONS -D__CUDA_NO_BFLOAT16_CONVERSIONS -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr -gencode=arch=compute_70,code=compute_70 -gencode=arch=compute_70,code=sm_70 --compiler-options '-fPIC' --expt-extended-lambda -std=c++17 -c /home/pc/dkw/OOTDiffusion/preprocess/humanparsing/modules/src/inplace_abn_cuda.cu -o inplace_abn_cuda.cuda.o /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.

dkw-wkd avatar Feb 26 '24 08:02 dkw-wkd

i have the same error

VinMing avatar Feb 27 '24 03:02 VinMing

@dkw-wkd 你好这里我需要你的CUDA版本等相关 依赖。 我在部署的时候遇到过C++缺失的情况。后续解决了。 目前我的环境如下: 我的环境是 CUDA Driver Version: 12.0

nvcc版本为: nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2022 NVIDIA Corporation Built on Tue_May__3_18:49:52_PDT_2022 Cuda compilation tools, release 11.7, V11.7.64 Build cuda_11.7.r11.7/compiler.31294372_0

G++版本为: g++ --version g++ (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0 Copyright (C) 2021 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

hariji814 avatar Feb 27 '24 06:02 hariji814

把文件/home/pc/.local/lib/python3.10/site-packages/torch/utils/cpp_extension.py 1893行的 '['ninja', '-v']' 改成 '['ninja', '--version']' 试试

nkTmmT avatar Feb 28 '24 01:02 nkTmmT

把文件/home/pc/.local/lib/python3.10/site-packages/torch/utils/cpp_extension.py 1893行的 '['ninja', '-v']' 改成 '['ninja', '--version']' 试试

改完后运行新的错误 Traceback (most recent call last): File "/Data2/wyw/OOTDiffusion/run/graido_ootd.py", line 20, in from preprocess.humanparsing.aigc_run_parsing import Parsing File "/Data2/wyw/OOTDiffusion/preprocess/humanparsing/aigc_run_parsing.py", line 7, in from parsing_api import load_atr_model, load_lip_model, inference File "/Data2/wyw/OOTDiffusion/preprocess/humanparsing/parsing_api.py", line 11, in import networks File "/Data2/wyw/OOTDiffusion/preprocess/humanparsing/networks/init.py", line 2, in from networks.AugmentCE2P import resnet101 File "/Data2/wyw/OOTDiffusion/preprocess/humanparsing/networks/AugmentCE2P.py", line 22, in from modules import InPlaceABNSync File "/Data2/wyw/OOTDiffusion/preprocess/humanparsing/modules/init.py", line 1, in from .bn import ABN, InPlaceABN, InPlaceABNSync File "/Data2/wyw/OOTDiffusion/preprocess/humanparsing/modules/bn.py", line 10, in from .functions import * File "/Data2/wyw/OOTDiffusion/preprocess/humanparsing/modules/functions.py", line 11, in _backend = load(name="inplace_abn", File "/home/wyw/anaconda3/envs/ootd/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 1284, in load return _jit_compile( File "/home/wyw/anaconda3/envs/ootd/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 1535, in _jit_compile return _import_module_from_library(name, build_directory, is_python_module) File "/home/wyw/anaconda3/envs/ootd/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 1930, in _import_module_from_library module = importlib.util.module_from_spec(spec) ImportError: /home/wyw/.cache/torch_extensions/py310_cu117/inplace_abn/inplace_abn.so: cannot open shared object file: No such file or directory

Aruen24 avatar Feb 28 '24 01:02 Aruen24

把文件/home/pc/.local/lib/python3.10/site-packages/torch/utils/cpp_extension.py 1893行的 '['ninja', '-v']' 改成 '['ninja', '--version']' 试试

同上

dkw-wkd avatar Feb 28 '24 01:02 dkw-wkd

@dkw-wkd 你好这里我需要你的CUDA版本等相关 依赖。 我在部署的时候遇到过C++缺失的情况。后续解决了。 目前我的环境如下: 我的环境是 CUDA Driver Version: 12.0

nvcc版本为: nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2022 NVIDIA Corporation Built on Tue_May__3_18:49:52_PDT_2022 Cuda compilation tools, release 11.7, V11.7.64 Build cuda_11.7.r11.7/compiler.31294372_0

G++版本为: g++ --version g++ (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0 Copyright (C) 2021 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

我的环境 CUDA Driver Version:11.7

nvcc 版本: nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2021 NVIDIA Corporation Built on Thu_Nov_18_09:45:30_PST_2021 Cuda compilation tools, release 11.5, V11.5.119 Build cuda_11.5.r11.5/compiler.30672275_0

gcc (Ubuntu 10.5.0-1ubuntu1~22.04) 10.5.0 Copyright (C) 2020 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

dkw-wkd avatar Feb 28 '24 01:02 dkw-wkd

我仔细观察了下类似的报错:都是会调用到c++17,然后使用c++11,我的环境中只有c++11, gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0 Copyright (C) 2021 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

g++也是11,所以把这俩更换为11可以解决问题。

hariji814 avatar Feb 28 '24 02:02 hariji814

@dkw-wkd If your problem has not been solved yet, you can refer to our latest model version. https://github.com/levihsu/OOTDiffusion/blob/main/requirements.txt

T-Gu avatar Mar 08 '24 07:03 T-Gu