Problems with pytorch Mask R-CNN tutorial


I was trying out the pytorch Mask R-CNN/Faster R-CNN tutorial and noticed a few problems.

Problem #1:
The first thing you see when you open the page is that there is a google colab you can open, but this link doesn’t work anymore.

I have pytorch 10.0 installed and torchvision 0.11.1.

I ignored the not existing google colab notebook and tried just running the code in the tutorial, and experienced some more problems.

Problem #2:

import transforms as T

Did not work, as there was no transform package, I tried pip install transforms, but that is another unrelated package. I eventually fixed this by changing it to:

import torchvision.transforms as T

Problem #3:
In the tutorial this line of code is given:

data_loader =, batch_size=2, shuffle=True, num_workers=4, collate_fn=collate_fn)

This causes problems because collate_fn is not an existing function, or I can’t find it. I tried looking in torch and torchvision but couldn’t find any collate_fn.

The putting everything together paragraph the tutorial states:
“In references/detection/, we have a number of helper functions to simplify training and evaluating detection models. Here, we will use references/detection/, references/detection/ and references/detection/ Just copy everything under references/detection to your folder and use them here.”

I have no idea where to find these folders to paste in my solution folder, I suspect the solution to my problem can be found there. Does anyone know where I can find them?

I downloaded the PennFudanDataset, I installed pycocotools because I am using a windows machine. I feel like I followed the appropriate steps.

Am I missing something? Or is this tutorial outdated and not possible to follow?

Thank you for your help in advance :slight_smile: