Setting near and far with scene bounds collider. Also LR schedules. (#74)

* some initial cuda code as I learn. using git to save progress.

* first cuda kernel for ray sampling that mostly works

* cleaning up code. working on lr. structs for scene bounds aabb

* added scene bounds collider code

* updated setup

* setup

* setup

* black

* including some files

* exporting env variable

* new file

* git workflows

* github actions

* github actions

* github actions

* removing env var
This commit is contained in:
Ethan Weber authored and GitHub committed 2022-05-16 14:03:19 -07:00
1 parent 752df417ce
commit 676beebb14
45 files changed
+803 -8354

No files matched your search

+1 -1
View File
@@ -56,7 +56,7 @@ def main():
trainer = Trainer(config, local_rank=0, world_size=1)
trainer.setup(test_mode=True)
avg_psnr = 0
for step, image_idx in enumerate(config.data.validation_image_indices):
for step, image_idx in enumerate(config.data.val_image_indices):
with torch.no_grad():
psnr = trainer.test_image(image_idx=image_idx, step=step)
avg_psnr = (step * avg_psnr + psnr) / (step + 1)
+2 -2
View File
@@ -15,8 +15,8 @@ if __name__ == "__main__":
if step["name"] == "Run Black":
curr_command = f"black mattport/ {step['with']['options']};"
else:
compressed = step["run"].replace("\n", "").replace("\\", "")
curr_command = f"{compressed};"
compressed = step["run"].replace("\n", ";").replace("\\", "")
curr_command = f"{compressed}"
print("*" * 100)
print(f"Running {curr_command}")
+4 -1
View File
@@ -18,6 +18,7 @@ from omegaconf import DictConfig
from mattport.nerf.trainer import Trainer
from mattport.utils import comms, profiler
from time import time
logging.basicConfig(format="[%(filename)s:%(lineno)d] %(message)s", level=logging.DEBUG)
@@ -99,7 +100,7 @@ def _distributed_worker(
assert num_gpus_per_machine <= torch.cuda.device_count()
torch.cuda.set_device(local_rank)
_set_random_seed(1234 + local_rank) # NOTE(ethan): will this work for multiple machines? should we use global_rank?
_set_random_seed(1234 + global_rank)
comms.synchronize(world_size)
output = main_func(local_rank, world_size, config)
@@ -148,9 +149,11 @@ def launch(
world_size = num_machines * num_gpus_per_machine
if world_size == 0:
# Using only CPU and one process.
_set_random_seed(0)
main_func(local_rank=0, world_size=0, config=config)
elif world_size == 1:
# Using one gpu and one process.
_set_random_seed(0)
try:
main_func(local_rank=0, world_size=1, config=config)
except KeyboardInterrupt: