From e27477eede49253ebfa1c8bdadfec198cc880111 Mon Sep 17 00:00:00 2001 From: Bingchen Gong <6704443+Wenri@users.noreply.github.com> Date: Thu, 9 Nov 2023 18:01:38 +0800 Subject: [PATCH 1/2] solving error: C++17 or later compatible compiler is required to use PyTorch --- ffmlp/backend.py | 4 ++-- ffmlp/setup.py | 4 ++-- gridencoder/backend.py | 4 ++-- gridencoder/setup.py | 4 ++-- raymarching/backend.py | 4 ++-- raymarching/setup.py | 4 ++-- shencoder/backend.py | 4 ++-- shencoder/setup.py | 4 ++-- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/ffmlp/backend.py b/ffmlp/backend.py index c33724a..c585211 100644 --- a/ffmlp/backend.py +++ b/ffmlp/backend.py @@ -4,14 +4,14 @@ _src_path = os.path.dirname(os.path.abspath(__file__)) nvcc_flags = [ - '-O3', '-std=c++14', + '-O3', '-std=c++17', '--expt-extended-lambda', '--expt-relaxed-constexpr', '-U__CUDA_NO_HALF_OPERATORS__', '-U__CUDA_NO_HALF_CONVERSIONS__', '-U__CUDA_NO_HALF2_OPERATORS__', ] if os.name == "posix": nvcc_flags += ['-Xcompiler=-mf16c', '-Xcompiler=-Wno-float-conversion', '-Xcompiler=-fno-strict-aliasing'] - c_flags = ['-O3', '-std=c++14'] + c_flags = ['-O3', '-std=c++17'] elif os.name == "nt": c_flags = ['/O2', '/std:c++17'] diff --git a/ffmlp/setup.py b/ffmlp/setup.py index a0f0cdb..02268e6 100644 --- a/ffmlp/setup.py +++ b/ffmlp/setup.py @@ -5,14 +5,14 @@ _src_path = os.path.dirname(os.path.abspath(__file__)) nvcc_flags = [ - '-O3', '-std=c++14', + '-O3', '-std=c++17', '--expt-extended-lambda', '--expt-relaxed-constexpr', '-U__CUDA_NO_HALF_OPERATORS__', '-U__CUDA_NO_HALF_CONVERSIONS__', '-U__CUDA_NO_HALF2_OPERATORS__', ] if os.name == "posix": nvcc_flags += ['-Xcompiler=-mf16c', '-Xcompiler=-Wno-float-conversion', '-Xcompiler=-fno-strict-aliasing'] - c_flags = ['-O3', '-std=c++14'] + c_flags = ['-O3', '-std=c++17'] elif os.name == "nt": c_flags = ['/O2', '/std:c++17'] diff --git a/gridencoder/backend.py b/gridencoder/backend.py index d99acb1..fa7b1f5 100644 --- a/gridencoder/backend.py +++ b/gridencoder/backend.py @@ -4,12 +4,12 @@ _src_path = os.path.dirname(os.path.abspath(__file__)) nvcc_flags = [ - '-O3', '-std=c++14', + '-O3', '-std=c++17', '-U__CUDA_NO_HALF_OPERATORS__', '-U__CUDA_NO_HALF_CONVERSIONS__', '-U__CUDA_NO_HALF2_OPERATORS__', ] if os.name == "posix": - c_flags = ['-O3', '-std=c++14'] + c_flags = ['-O3', '-std=c++17'] elif os.name == "nt": c_flags = ['/O2', '/std:c++17'] diff --git a/gridencoder/setup.py b/gridencoder/setup.py index 714bf1c..69028a7 100644 --- a/gridencoder/setup.py +++ b/gridencoder/setup.py @@ -5,12 +5,12 @@ _src_path = os.path.dirname(os.path.abspath(__file__)) nvcc_flags = [ - '-O3', '-std=c++14', + '-O3', '-std=c++17', '-U__CUDA_NO_HALF_OPERATORS__', '-U__CUDA_NO_HALF_CONVERSIONS__', '-U__CUDA_NO_HALF2_OPERATORS__', ] if os.name == "posix": - c_flags = ['-O3', '-std=c++14'] + c_flags = ['-O3', '-std=c++17'] elif os.name == "nt": c_flags = ['/O2', '/std:c++17'] diff --git a/raymarching/backend.py b/raymarching/backend.py index 8771fe3..78cf133 100644 --- a/raymarching/backend.py +++ b/raymarching/backend.py @@ -4,12 +4,12 @@ _src_path = os.path.dirname(os.path.abspath(__file__)) nvcc_flags = [ - '-O3', '-std=c++14', + '-O3', '-std=c++17', '-U__CUDA_NO_HALF_OPERATORS__', '-U__CUDA_NO_HALF_CONVERSIONS__', '-U__CUDA_NO_HALF2_OPERATORS__', ] if os.name == "posix": - c_flags = ['-O3', '-std=c++14'] + c_flags = ['-O3', '-std=c++17'] elif os.name == "nt": c_flags = ['/O2', '/std:c++17'] diff --git a/raymarching/setup.py b/raymarching/setup.py index d974499..11dfef8 100644 --- a/raymarching/setup.py +++ b/raymarching/setup.py @@ -5,12 +5,12 @@ _src_path = os.path.dirname(os.path.abspath(__file__)) nvcc_flags = [ - '-O3', '-std=c++14', + '-O3', '-std=c++17', '-U__CUDA_NO_HALF_OPERATORS__', '-U__CUDA_NO_HALF_CONVERSIONS__', '-U__CUDA_NO_HALF2_OPERATORS__', ] if os.name == "posix": - c_flags = ['-O3', '-std=c++14'] + c_flags = ['-O3', '-std=c++17'] elif os.name == "nt": c_flags = ['/O2', '/std:c++17'] diff --git a/shencoder/backend.py b/shencoder/backend.py index cc08a3e..a9f40d1 100644 --- a/shencoder/backend.py +++ b/shencoder/backend.py @@ -4,12 +4,12 @@ _src_path = os.path.dirname(os.path.abspath(__file__)) nvcc_flags = [ - '-O3', '-std=c++14', + '-O3', '-std=c++17', '-U__CUDA_NO_HALF_OPERATORS__', '-U__CUDA_NO_HALF_CONVERSIONS__', '-U__CUDA_NO_HALF2_OPERATORS__', ] if os.name == "posix": - c_flags = ['-O3', '-std=c++14'] + c_flags = ['-O3', '-std=c++17'] elif os.name == "nt": c_flags = ['/O2', '/std:c++17'] diff --git a/shencoder/setup.py b/shencoder/setup.py index 342a601..1d001fe 100644 --- a/shencoder/setup.py +++ b/shencoder/setup.py @@ -5,12 +5,12 @@ _src_path = os.path.dirname(os.path.abspath(__file__)) nvcc_flags = [ - '-O3', '-std=c++14', + '-O3', '-std=c++17', '-U__CUDA_NO_HALF_OPERATORS__', '-U__CUDA_NO_HALF_CONVERSIONS__', '-U__CUDA_NO_HALF2_OPERATORS__', ] if os.name == "posix": - c_flags = ['-O3', '-std=c++14'] + c_flags = ['-O3', '-std=c++17'] elif os.name == "nt": c_flags = ['/O2', '/std:c++17'] From 6777f108f1887305f317a3962ce8d90b3fbb27c7 Mon Sep 17 00:00:00 2001 From: Bingchen Gong <6704443+Wenri@users.noreply.github.com> Date: Thu, 9 Nov 2023 18:02:15 +0800 Subject: [PATCH 2/2] fixing data_range error --- nerf/metrics.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nerf/metrics.py b/nerf/metrics.py index 022b072..b9869fc 100644 --- a/nerf/metrics.py +++ b/nerf/metrics.py @@ -40,7 +40,7 @@ def lpips(rendered, target): def ssim(rendered, target): rendered = normalize_to_neg_one_to_one(rendered)[0] target = normalize_to_neg_one_to_one(target)[0] - return float(skimage.metrics.structural_similarity(rendered, target, channel_axis=-1)) + return float(skimage.metrics.structural_similarity(rendered, target, data_range=2., channel_axis=-1)) def psnr(rendered, target):