diff --git a/nerfstudio/field_components/encodings.py b/nerfstudio/field_components/encodings.py index 94cd1f1894..71d3e4a6c0 100644 --- a/nerfstudio/field_components/encodings.py +++ b/nerfstudio/field_components/encodings.py @@ -34,7 +34,7 @@ import tinycudann as tcnn TCNN_EXISTS = True -except ImportError: +except ModuleNotFoundError: TCNN_EXISTS = False diff --git a/nerfstudio/fields/instant_ngp_field.py b/nerfstudio/fields/instant_ngp_field.py index b75c539ed7..3941e7ec93 100644 --- a/nerfstudio/fields/instant_ngp_field.py +++ b/nerfstudio/fields/instant_ngp_field.py @@ -38,7 +38,7 @@ try: import tinycudann as tcnn -except ImportError: +except ModuleNotFoundError: # tinycudann module doesn't exist pass diff --git a/nerfstudio/fields/nerfacto_field.py b/nerfstudio/fields/nerfacto_field.py index b1b1c2cfb7..e828ac6647 100644 --- a/nerfstudio/fields/nerfacto_field.py +++ b/nerfstudio/fields/nerfacto_field.py @@ -49,7 +49,7 @@ try: import tinycudann as tcnn -except ImportError: +except ModuleNotFoundError: # tinycudann module doesn't exist pass diff --git a/nerfstudio/fields/nerfplayer_nerfacto_field.py b/nerfstudio/fields/nerfplayer_nerfacto_field.py index 0dc4ba4cea..759806f84b 100644 --- a/nerfstudio/fields/nerfplayer_nerfacto_field.py +++ b/nerfstudio/fields/nerfplayer_nerfacto_field.py @@ -43,7 +43,7 @@ try: import tinycudann as tcnn -except ImportError: +except ModuleNotFoundError: # tinycudann module doesn't exist pass diff --git a/nerfstudio/fields/nerfplayer_ngp_field.py b/nerfstudio/fields/nerfplayer_ngp_field.py index 8036377291..38f70e5470 100644 --- a/nerfstudio/fields/nerfplayer_ngp_field.py +++ b/nerfstudio/fields/nerfplayer_ngp_field.py @@ -38,7 +38,7 @@ try: import tinycudann as tcnn -except ImportError: +except ModuleNotFoundError: # tinycudann module doesn't exist pass diff --git a/nerfstudio/fields/sdf_field.py b/nerfstudio/fields/sdf_field.py index 031614f2f1..a6d2229337 100644 --- a/nerfstudio/fields/sdf_field.py +++ b/nerfstudio/fields/sdf_field.py @@ -36,7 +36,7 @@ try: import tinycudann as tcnn -except ImportError: +except ModuleNotFoundError: # tinycudann module doesn't exist pass diff --git a/tests/field_components/test_fields.py b/tests/field_components/test_fields.py index 4714ed4d9f..9e5611fcc7 100644 --- a/tests/field_components/test_fields.py +++ b/tests/field_components/test_fields.py @@ -11,7 +11,7 @@ def test_tcnn_instant_ngp_field(): """Test the tiny-cuda-nn field""" try: import tinycudann as tcnn # noqa: F401 - except ImportError as e: + except ModuleNotFoundError as e: # tinycudann module doesn't exist print(e) return