mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-11-19 22:25:44 +08:00
Backward compatibility for torch 1.x and fix for windows (#1962)
* backward compatibility for torch 1.x and fix for windows * Update pyproject.toml * Update README.md * Update README.md (As per request) --------- Co-authored-by: machenmusik <machenmusik@users.noreply.github.com>
This commit is contained in:
1 parent
c86ae8a07f
commit
3bc160cc7d
6 files changed
+33
-6
No files matched your search
@@ -21,7 +21,12 @@ from typing import Literal, Optional, Tuple, Type
|
||||
|
||||
import numpy as np
|
||||
from torch.optim import Optimizer, lr_scheduler
|
||||
from torch.optim.lr_scheduler import LRScheduler
|
||||
|
||||
try:
|
||||
from torch.optim.lr_scheduler import LRScheduler
|
||||
except ImportError:
|
||||
# Backwards compatibility for PyTorch 1.x
|
||||
from torch.optim.lr_scheduler import _LRScheduler as LRScheduler
|
||||
|
||||
from nerfstudio.configs.base_config import InstantiateConfig
|
||||
|
||||
|
||||
Reference in new issue
Block a user