mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-12-07 00:09:14 +08:00
lint
This commit is contained in:
1 parent
b8e2713643
commit
563dba0bad
1 file changed
+2
-4
@@ -22,9 +22,6 @@ class Trainer:
|
|||||||
self.graph = None
|
self.graph = None
|
||||||
self.optimizer = None
|
self.optimizer = None
|
||||||
|
|
||||||
self.device = f"cuda:{local_rank}"
|
|
||||||
self.is_main_thread = self.local_rank % self.world_size == 0
|
|
||||||
|
|
||||||
def setup_dataset(self):
|
def setup_dataset(self):
|
||||||
"""_summary_"""
|
"""_summary_"""
|
||||||
self.train_dataset = build_dataset(self.config.dataset)
|
self.train_dataset = build_dataset(self.config.dataset)
|
||||||
@@ -32,7 +29,7 @@ class Trainer:
|
|||||||
|
|
||||||
def setup_graph(self):
|
def setup_graph(self):
|
||||||
"""_summary_"""
|
"""_summary_"""
|
||||||
self.graph = Graph(self.config.network).to(self.device)
|
self.graph = Graph(self.config.network).to(f"cuda:{self.local_rank}")
|
||||||
if self.world_size > 1:
|
if self.world_size > 1:
|
||||||
self.graph = DDP(self.graph, device_ids=[self.local_rank])
|
self.graph = DDP(self.graph, device_ids=[self.local_rank])
|
||||||
dist.barrier(device_ids=[self.local_rank])
|
dist.barrier(device_ids=[self.local_rank])
|
||||||
@@ -59,6 +56,7 @@ class Trainer:
|
|||||||
|
|
||||||
def train(self) -> None:
|
def train(self) -> None:
|
||||||
"""_summary_"""
|
"""_summary_"""
|
||||||
|
# is_main_thread = self.local_rank % self.world_size == 0
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
def train_epoch(self):
|
def train_epoch(self):
|
||||||
|
|||||||
Reference in new issue
Block a user