Skip to content

Commit

Permalink
<TMP> torchprofile
Browse files Browse the repository at this point in the history
  • Loading branch information
JY251 committed Jul 4, 2024
1 parent 4aaa60b commit 9a8a7cd
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions run_nerf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 9a8a7cd

Please sign in to comment.