Skip to content

Commit 069e507

Browse files
committed
Few more rendering fixes and reduced num epochs to run less than 3 minutes
1 parent a2b39cb commit 069e507

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

intermediate_source/torchvision_tutorial.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,7 @@ def get_model_instance_segmentation(num_classes):
356356
os.system("wget https://raw.githubusercontent.com/pytorch/vision/main/references/detection/coco_eval.py")
357357
os.system("wget https://raw.githubusercontent.com/pytorch/vision/main/references/detection/transforms.py")
358358

359+
######################################################################
359360
# Since v0.15.0 torchvision provides `new Transforms API <https://pytorch.org/vision/stable/transforms.html>`_
360361
# to easily write data augmentation pipelines for Object Detection and Segmentation tasks.
361362
#
@@ -373,7 +374,7 @@ def get_transform(train):
373374
transforms.append(T.ToPureTensor())
374375
return T.Compose(transforms)
375376

376-
377+
######################################################################
377378
# Testing ``forward()`` method (Optional)
378379
# ---------------------------------------
379380
#
@@ -466,8 +467,8 @@ def get_transform(train):
466467
gamma=0.1
467468
)
468469

469-
# let's train it for 5 epochs
470-
num_epochs = 5
470+
# let's train it just for 2 epochs
471+
num_epochs = 2
471472

472473
for epoch in range(num_epochs):
473474
# train for one epoch, printing every 10 iterations

0 commit comments

Comments
 (0)