I think that the tutorial was written based on an old version (v0.8.2) of Torchvision source code.
You can see ToTensor()
method in the file:
Further, if you look at the Google Colab file, you can notice that somewhere down the line, they checkout a specific Github tag (v0.8.2
) before executing the code.
# Download TorchVision repo to use some files from
# references/detection
git clone https://github.com/pytorch/vision.git
cd vision
git checkout v0.8.2
cp references/detection/utils.py ../
cp references/detection/transforms.py ../
cp references/detection/coco_eval.py ../
cp references/detection/engine.py ../
cp references/detection/coco_utils.py ../