From 9a8a7cdc1be8450dd80e1b90f17f2960bd0b5761 Mon Sep 17 00:00:00 2001 From: JY251 <101054474+JY251@users.noreply.github.com> Date: Thu, 4 Jul 2024 22:29:00 +0000 Subject: [PATCH] torchprofile --- run_nerf.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/run_nerf.py b/run_nerf.py index 49f846b..a14313c 100644 --- a/run_nerf.py +++ b/run_nerf.py @@ -811,12 +811,15 @@ def train(): # Make predictions for color, disparity, accumulated opacity. # NOTE: これがメインの処理: 3 -> 4に相当 - time_before_render = time.time() - rgb, disp, acc, extras = render( - H, W, focal, chunk=args.chunk, rays=batch_rays, - verbose=i < 10, retraw=True, **render_kwargs_train) - time_after_render = time.time() - time_render = time_after_render - time_before_render + # time_before_render = time.time() + import torchprofile + with torchprofile.profile() as profiler: + rgb, disp, acc, extras = render( + H, W, focal, chunk=args.chunk, rays=batch_rays, + verbose=i < 10, retraw=True, **render_kwargs_train) + print(profiler) + # time_after_render = time.time() + # time_render = time_after_render - time_before_render # Compute MSE loss between predicted and true RGB. time_before_loss = time.time()