mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-11-19 22:25:44 +08:00
Fix import error when tcnn installed but CUDA runtime not available (#2429)
This commit is contained in:
1 parent
7269a7ee16
commit
ef2fd3dbe1
6 files changed
+68
-26
No files matched your search
@@ -5,15 +5,14 @@ import torch
|
||||
|
||||
from nerfstudio.cameras.rays import Frustums, RaySamples
|
||||
from nerfstudio.fields.nerfacto_field import NerfactoField
|
||||
from nerfstudio.utils.external import TCNN_EXISTS, tcnn_import_exception
|
||||
|
||||
|
||||
def test_nerfacto_field():
|
||||
"""Test the Nerfacto field"""
|
||||
try:
|
||||
import tinycudann as tcnn # noqa: F401
|
||||
except ModuleNotFoundError as e:
|
||||
if not TCNN_EXISTS:
|
||||
# tinycudann module doesn't exist
|
||||
print(e)
|
||||
print(tcnn_import_exception)
|
||||
return
|
||||
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
||||
aabb_scale = 1.0
|
||||
|
||||
Reference in new issue
Block a user