-
Notifications
You must be signed in to change notification settings - Fork 69
Description
(venv) (base) bigdata@gpu2 HairFastGAN (main) $ CUDA_VISIBLE_DEVICES=6 python test.py
/home/bigdata/projects/ysl/paint/hairfast/HairFastGAN/venv/lib/python3.11/site-packages/torch/utils/cpp_extension.py:1965: UserWarning: TORCH_CUDA_ARCH_LIST is not set, all archs for visible cards are included for compilation.
If this is not desired, please set os.environ['TORCH_CUDA_ARCH_LIST'].
warnings.warn(
Traceback (most recent call last):
File "/home/bigdata/projects/ysl/paint/hairfast/HairFastGAN/venv/lib/python3.11/site-packages/torch/utils/cpp_extension.py", line 2105, in _run_ninja_build
subprocess.run(
File "/opt/anaconda3/lib/python3.11/subprocess.py", line 571, 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/bigdata/projects/ysl/paint/hairfast/HairFastGAN/test.py", line 1, in
from hair_swap import HairFast, get_parser
File "/home/bigdata/projects/ysl/paint/hairfast/HairFastGAN/hair_swap.py", line 13, in
from models.Alignment import Alignment
File "/home/bigdata/projects/ysl/paint/hairfast/HairFastGAN/models/Alignment.py", line 8, in
from models.Encoders import RotateModel
File "/home/bigdata/projects/ysl/paint/hairfast/HairFastGAN/models/Encoders.py", line 9, in
from models.Net import FeatureEncoderMult, IBasicBlock, conv1x1
File "/home/bigdata/projects/ysl/paint/hairfast/HairFastGAN/models/Net.py", line 9, in
from models.stylegan2.model import Generator
File "/home/bigdata/projects/ysl/paint/hairfast/HairFastGAN/models/stylegan2/model.py", line 11, in
from models.stylegan2.op import FusedLeakyReLU, fused_leaky_relu, upfirdn2d
File "/home/bigdata/projects/ysl/paint/hairfast/HairFastGAN/models/stylegan2/op/init.py", line 1, in
from .fused_act import FusedLeakyReLU, fused_leaky_relu
File "/home/bigdata/projects/ysl/paint/hairfast/HairFastGAN/models/stylegan2/op/fused_act.py", line 10, in
fused = load(
^^^^^
File "/home/bigdata/projects/ysl/paint/hairfast/HairFastGAN/venv/lib/python3.11/site-packages/torch/utils/cpp_extension.py", line 1312, in load
return jit_compile(
^^^^^^^^^^^^^
File "/home/bigdata/projects/ysl/paint/hairfast/HairFastGAN/venv/lib/python3.11/site-packages/torch/utils/cpp_extension.py", line 1722, in jit_compile
write_ninja_file_and_build_library(
File "/home/bigdata/projects/ysl/paint/hairfast/HairFastGAN/venv/lib/python3.11/site-packages/torch/utils/cpp_extension.py", line 1834, in write_ninja_file_and_build_library
run_ninja_build(
File "/home/bigdata/projects/ysl/paint/hairfast/HairFastGAN/venv/lib/python3.11/site-packages/torch/utils/cpp_extension.py", line 2121, in run_ninja_build
raise RuntimeError(message) from e
RuntimeError: Error building extension 'fused': [1/3] /usr/local/cuda-12.2:/bin/nvcc --generate-dependencies-with-compile --dependency-output fused_bias_act_kernel.cuda.o.d -DTORCH_EXTENSION_NAME=fused -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE="gcc" -DPYBIND11_STDLIB="libstdcpp" -DPYBIND11_BUILD_ABI="cxxabi1011" -isystem /home/bigdata/projects/ysl/paint/hairfast/HairFastGAN/venv/lib/python3.11/site-packages/torch/include -isystem /home/bigdata/projects/ysl/paint/hairfast/HairFastGAN/venv/lib/python3.11/site-packages/torch/include/torch/csrc/api/include -isystem /home/bigdata/projects/ysl/paint/hairfast/HairFastGAN/venv/lib/python3.11/site-packages/torch/include/TH -isystem /home/bigdata/projects/ysl/paint/hairfast/HairFastGAN/venv/lib/python3.11/site-packages/torch/include/THC -isystem /usr/local/cuda-12.2:/include -isystem /opt/anaconda3/include/python3.11 -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_80,code=compute_80 -gencode=arch=compute_80,code=sm_80 --compiler-options '-fPIC' -std=c++17 -c /home/bigdata/projects/ysl/paint/hairfast/HairFastGAN/models/stylegan2/op/fused_bias_act_kernel.cu -o fused_bias_act_kernel.cuda.o
FAILED: fused_bias_act_kernel.cuda.o
/usr/local/cuda-12.2:/bin/nvcc --generate-dependencies-with-compile --dependency-output fused_bias_act_kernel.cuda.o.d -DTORCH_EXTENSION_NAME=fused -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE="gcc" -DPYBIND11_STDLIB="libstdcpp" -DPYBIND11_BUILD_ABI="cxxabi1011" -isystem /home/bigdata/projects/ysl/paint/hairfast/HairFastGAN/venv/lib/python3.11/site-packages/torch/include -isystem /home/bigdata/projects/ysl/paint/hairfast/HairFastGAN/venv/lib/python3.11/site-packages/torch/include/torch/csrc/api/include -isystem /home/bigdata/projects/ysl/paint/hairfast/HairFastGAN/venv/lib/python3.11/site-packages/torch/include/TH -isystem /home/bigdata/projects/ysl/paint/hairfast/HairFastGAN/venv/lib/python3.11/site-packages/torch/include/THC -isystem /usr/local/cuda-12.2:/include -isystem /opt/anaconda3/include/python3.11 -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_80,code=compute_80 -gencode=arch=compute_80,code=sm_80 --compiler-options '-fPIC' -std=c++17 -c /home/bigdata/projects/ysl/paint/hairfast/HairFastGAN/models/stylegan2/op/fused_bias_act_kernel.cu -o fused_bias_act_kernel.cuda.o
/bin/sh: 1: /usr/local/cuda-12.2:/bin/nvcc: not found
[2/3] c++ -MMD -MF fused_bias_act.o.d -DTORCH_EXTENSION_NAME=fused -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE="_gcc" -DPYBIND11_STDLIB="_libstdcpp" -DPYBIND11_BUILD_ABI="_cxxabi1011" -isystem /home/bigdata/projects/ysl/paint/hairfast/HairFastGAN/venv/lib/python3.11/site-packages/torch/include -isystem /home/bigdata/projects/ysl/paint/hairfast/HairFastGAN/venv/lib/python3.11/site-packages/torch/include/torch/csrc/api/include -isystem /home/bigdata/projects/ysl/paint/hairfast/HairFastGAN/venv/lib/python3.11/site-packages/torch/include/TH -isystem /home/bigdata/projects/ysl/paint/hairfast/HairFastGAN/venv/lib/python3.11/site-packages/torch/include/THC -isystem /usr/local/cuda-12.2:/include -isystem /opt/anaconda3/include/python3.11 -D_GLIBCXX_USE_CXX11_ABI=0 -fPIC -std=c++17 -c /home/bigdata/projects/ysl/paint/hairfast/HairFastGAN/models/stylegan2/op/fused_bias_act.cpp -o fused_bias_act.o
In file included from /home/bigdata/projects/ysl/paint/hairfast/HairFastGAN/venv/lib/python3.11/site-packages/torch/include/c10/util/Exception.h:5,
from /home/bigdata/projects/ysl/paint/hairfast/HairFastGAN/venv/lib/python3.11/site-packages/torch/include/c10/core/Device.h:5,
from /home/bigdata/projects/ysl/paint/hairfast/HairFastGAN/venv/lib/python3.11/site-packages/torch/include/ATen/core/TensorBody.h:11,
from /home/bigdata/projects/ysl/paint/hairfast/HairFastGAN/venv/lib/python3.11/site-packages/torch/include/ATen/core/Tensor.h:3,
from /home/bigdata/projects/ysl/paint/hairfast/HairFastGAN/venv/lib/python3.11/site-packages/torch/include/ATen/Tensor.h:3,
from /home/bigdata/projects/ysl/paint/hairfast/HairFastGAN/venv/lib/python3.11/site-packages/torch/include/torch/csrc/autograd/function_hook.h:3,
from /home/bigdata/projects/ysl/paint/hairfast/HairFastGAN/venv/lib/python3.11/site-packages/torch/include/torch/csrc/autograd/cpp_hook.h:2,
from /home/bigdata/projects/ysl/paint/hairfast/HairFastGAN/venv/lib/python3.11/site-packages/torch/include/torch/csrc/autograd/variable.h:6,
from /home/bigdata/projects/ysl/paint/hairfast/HairFastGAN/venv/lib/python3.11/site-packages/torch/include/torch/csrc/autograd/autograd.h:3,
from /home/bigdata/projects/ysl/paint/hairfast/HairFastGAN/venv/lib/python3.11/site-packages/torch/include/torch/csrc/api/include/torch/autograd.h:3,
from /home/bigdata/projects/ysl/paint/hairfast/HairFastGAN/venv/lib/python3.11/site-packages/torch/include/torch/csrc/api/include/torch/all.h:7,
from /home/bigdata/projects/ysl/paint/hairfast/HairFastGAN/venv/lib/python3.11/site-packages/torch/include/torch/extension.h:5,
from /home/bigdata/projects/ysl/paint/hairfast/HairFastGAN/models/stylegan2/op/fused_bias_act.cpp:1:
/home/bigdata/projects/ysl/paint/hairfast/HairFastGAN/models/stylegan2/op/fused_bias_act.cpp: In function ‘at::Tensor fused_bias_act(const at::Tensor&, const at::Tensor&, const at::Tensor&, int, int, float, float)’:
/home/bigdata/projects/ysl/paint/hairfast/HairFastGAN/models/stylegan2/op/fused_bias_act.cpp:7:42: warning: ‘at::DeprecatedTypeProperties& at::Tensor::type() const’ is deprecated: Tensor.type() is deprecated. Instead use Tensor.options(), which in many cases (e.g. in a constructor) is a drop-in replacement. If you were using data from type(), that is now available from Tensor itself, so instead of tensor.type().scalar_type(), use tensor.scalar_type() instead and instead of tensor.type().backend() use tensor.device(). [-Wdeprecated-declarations]
7 | #define CHECK_CUDA(x) TORCH_CHECK(x.type().is_cuda(), #x " must be a CUDA tensor")
| ^
/home/bigdata/projects/ysl/paint/hairfast/HairFastGAN/models/stylegan2/op/fused_bias_act.cpp:13:5: note: in expansion of macro ‘CHECK_CUDA’
13 | CHECK_CUDA(input);
| ^~~~~~~~~~
In file included from /home/bigdata/projects/ysl/paint/hairfast/HairFastGAN/venv/lib/python3.11/site-packages/torch/include/ATen/core/Tensor.h:3,
from /home/bigdata/projects/ysl/paint/hairfast/HairFastGAN/venv/lib/python3.11/site-packages/torch/include/ATen/Tensor.h:3,
from /home/bigdata/projects/ysl/paint/hairfast/HairFastGAN/venv/lib/python3.11/site-packages/torch/include/torch/csrc/autograd/function_hook.h:3,
from /home/bigdata/projects/ysl/paint/hairfast/HairFastGAN/venv/lib/python3.11/site-packages/torch/include/torch/csrc/autograd/cpp_hook.h:2,
from /home/bigdata/projects/ysl/paint/hairfast/HairFastGAN/venv/lib/python3.11/site-packages/torch/include/torch/csrc/autograd/variable.h:6,
from /home/bigdata/projects/ysl/paint/hairfast/HairFastGAN/venv/lib/python3.11/site-packages/torch/include/torch/csrc/autograd/autograd.h:3,
from /home/bigdata/projects/ysl/paint/hairfast/HairFastGAN/venv/lib/python3.11/site-packages/torch/include/torch/csrc/api/include/torch/autograd.h:3,
from /home/bigdata/projects/ysl/paint/hairfast/HairFastGAN/venv/lib/python3.11/site-packages/torch/include/torch/csrc/api/include/torch/all.h:7,
from /home/bigdata/projects/ysl/paint/hairfast/HairFastGAN/venv/lib/python3.11/site-packages/torch/include/torch/extension.h:5,
from /home/bigdata/projects/ysl/paint/hairfast/HairFastGAN/models/stylegan2/op/fused_bias_act.cpp:1:
/home/bigdata/projects/ysl/paint/hairfast/HairFastGAN/venv/lib/python3.11/site-packages/torch/include/ATen/core/TensorBody.h:225:30: note: declared here
225 | DeprecatedTypeProperties & type() const {
| ^~~~
In file included from /home/bigdata/projects/ysl/paint/hairfast/HairFastGAN/venv/lib/python3.11/site-packages/torch/include/c10/util/Exception.h:5,
from /home/bigdata/projects/ysl/paint/hairfast/HairFastGAN/venv/lib/python3.11/site-packages/torch/include/c10/core/Device.h:5,
from /home/bigdata/projects/ysl/paint/hairfast/HairFastGAN/venv/lib/python3.11/site-packages/torch/include/ATen/core/TensorBody.h:11,
from /home/bigdata/projects/ysl/paint/hairfast/HairFastGAN/venv/lib/python3.11/site-packages/torch/include/ATen/core/Tensor.h:3,
from /home/bigdata/projects/ysl/paint/hairfast/HairFastGAN/venv/lib/python3.11/site-packages/torch/include/ATen/Tensor.h:3,
from /home/bigdata/projects/ysl/paint/hairfast/HairFastGAN/venv/lib/python3.11/site-packages/torch/include/torch/csrc/autograd/function_hook.h:3,
from /home/bigdata/projects/ysl/paint/hairfast/HairFastGAN/venv/lib/python3.11/site-packages/torch/include/torch/csrc/autograd/cpp_hook.h:2,
from /home/bigdata/projects/ysl/paint/hairfast/HairFastGAN/venv/lib/python3.11/site-packages/torch/include/torch/csrc/autograd/variable.h:6,
from /home/bigdata/projects/ysl/paint/hairfast/HairFastGAN/venv/lib/python3.11/site-packages/torch/include/torch/csrc/autograd/autograd.h:3,
from /home/bigdata/projects/ysl/paint/hairfast/HairFastGAN/venv/lib/python3.11/site-packages/torch/include/torch/csrc/api/include/torch/autograd.h:3,
from /home/bigdata/projects/ysl/paint/hairfast/HairFastGAN/venv/lib/python3.11/site-packages/torch/include/torch/csrc/api/include/torch/all.h:7,
from /home/bigdata/projects/ysl/paint/hairfast/HairFastGAN/venv/lib/python3.11/site-packages/torch/include/torch/extension.h:5,
from /home/bigdata/projects/ysl/paint/hairfast/HairFastGAN/models/stylegan2/op/fused_bias_act.cpp:1:
/home/bigdata/projects/ysl/paint/hairfast/HairFastGAN/models/stylegan2/op/fused_bias_act.cpp:7:42: warning: ‘at::DeprecatedTypeProperties& at::Tensor::type() const’ is deprecated: Tensor.type() is deprecated. Instead use Tensor.options(), which in many cases (e.g. in a constructor) is a drop-in replacement. If you were using data from type(), that is now available from Tensor itself, so instead of tensor.type().scalar_type(), use tensor.scalar_type() instead and instead of tensor.type().backend() use tensor.device(). [-Wdeprecated-declarations]
7 | #define CHECK_CUDA(x) TORCH_CHECK(x.type().is_cuda(), #x " must be a CUDA tensor")
| ^
/home/bigdata/projects/ysl/paint/hairfast/HairFastGAN/models/stylegan2/op/fused_bias_act.cpp:14:5: note: in expansion of macro ‘CHECK_CUDA’
14 | CHECK_CUDA(bias);
| ^~~~~~~~~~
In file included from /home/bigdata/projects/ysl/paint/hairfast/HairFastGAN/venv/lib/python3.11/site-packages/torch/include/ATen/core/Tensor.h:3,
from /home/bigdata/projects/ysl/paint/hairfast/HairFastGAN/venv/lib/python3.11/site-packages/torch/include/ATen/Tensor.h:3,
from /home/bigdata/projects/ysl/paint/hairfast/HairFastGAN/venv/lib/python3.11/site-packages/torch/include/torch/csrc/autograd/function_hook.h:3,
from /home/bigdata/projects/ysl/paint/hairfast/HairFastGAN/venv/lib/python3.11/site-packages/torch/include/torch/csrc/autograd/cpp_hook.h:2,
from /home/bigdata/projects/ysl/paint/hairfast/HairFastGAN/venv/lib/python3.11/site-packages/torch/include/torch/csrc/autograd/variable.h:6,
from /home/bigdata/projects/ysl/paint/hairfast/HairFastGAN/venv/lib/python3.11/site-packages/torch/include/torch/csrc/autograd/autograd.h:3,
from /home/bigdata/projects/ysl/paint/hairfast/HairFastGAN/venv/lib/python3.11/site-packages/torch/include/torch/csrc/api/include/torch/autograd.h:3,
from /home/bigdata/projects/ysl/paint/hairfast/HairFastGAN/venv/lib/python3.11/site-packages/torch/include/torch/csrc/api/include/torch/all.h:7,
from /home/bigdata/projects/ysl/paint/hairfast/HairFastGAN/venv/lib/python3.11/site-packages/torch/include/torch/extension.h:5,
from /home/bigdata/projects/ysl/paint/hairfast/HairFastGAN/models/stylegan2/op/fused_bias_act.cpp:1:
/home/bigdata/projects/ysl/paint/hairfast/HairFastGAN/venv/lib/python3.11/site-packages/torch/include/ATen/core/TensorBody.h:225:30: note: declared here
225 | DeprecatedTypeProperties & type() const {
| ^~~~
ninja: build stopped: subcommand failed.
test.py code:
`from hair_swap import HairFast, get_parser
Init HairFast
hair_fast = HairFast(get_parser().parse_args([]))
Inference
face_img = "./input/y.jpg"
shape_img = "./input/yy.jpg"
color_img = "./input/yyy.jpg"
result = hair_fast(face_img, shape_img, color_img)
print(result)`
I have tried Python 3.10 and 3.11, both of which have this issue, help me