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 48e475d commit d50a814
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")
t = Tensor(build_transforms()(Image.open(img_filename).convert("RGB")).numpy(), requires_grad=True).realize()
print_gpu_memory("after_load")
del t
gc.collect()
print_gpu_memory("after_del")
img = [Tensor(build_transforms()(Image.open(img_filename).convert("RGB")).numpy(), requires_grad=True)]
images = to_image_list(img)
print_gpu_memory("before images")
Expand Down

0 comments on commit d50a814

Please sign in to comment.