diff --git a/nerfstudio/utils/misc.py b/nerfstudio/utils/misc.py index 5b40117e9..e95bd4188 100644 --- a/nerfstudio/utils/misc.py +++ b/nerfstudio/utils/misc.py @@ -19,6 +19,7 @@ Miscellaneous helper code. import platform from typing import Any, Callable, Dict, List, Optional, TypeVar, Union +import warnings import torch @@ -167,11 +168,17 @@ def torch_compile(*args, **kwargs): """ if not hasattr(torch, "compile"): # Backward compatibility for PyTorch 1.x + warnings.warn( + "PyTorch 1.x will no longer be supported by Nerstudio. Please upgrade to PyTorch 2.x.", DeprecationWarning + ) return torch.jit.script elif platform.system() == "Windows": # torch.compile is not supported on Windows # https://github.com/orgs/pytorch/projects/27 # TODO: @jkulhanek, remove this once torch.compile is supported on Windows + warnings.warn( + "Windows does not yet support torch.compile and the performance will be affected.", RuntimeWarning + ) return lambda x: x else: return torch.compile(*args, **kwargs)