Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
waifairer committed Oct 20, 2023
1 parent d50a814 commit f2e908f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions examples/mask_rcnn/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,12 @@ def simple():
img_metadata = coco.loadImgs(random_img_id)[0]
img_filename = os.path.join(BASEDIR, 'train2017', img_metadata['file_name'])
print("training", img_filename)
print_gpu_memory("before_load_no_transforms")
t = Tensor(Image.open(img_filename).convert("RGB"), requires_grad=True).realize()
print_gpu_memory("after_load_no_transforms")
del t
gc.collect()
print_gpu_memory("after_del")
print_gpu_memory("before_load")
t = Tensor(build_transforms()(Image.open(img_filename).convert("RGB")).numpy(), requires_grad=True).realize()
print_gpu_memory("after_load")
Expand Down

0 comments on commit f2e908f

Please sign in to comment.