Skip to content

Commit f9b5840

Browse files
To solve the wrong example of MultiScaleRoIAlign() (pytorch#1085)
In this [docs](https://pytorch.org/tutorials/intermediate/torchvision_tutorial.html), the `2 - Modifying the model to add a different backbone` part has wrong example code. ```python roi_pooler = torchvision.ops.MultiScaleRoIAlign(featmap_names=[0], output_size=7, sampling_ratio=2) ``` should be ``` roi_pooler = torchvision.ops.MultiScaleRoIAlign(featmap_names=['0'], output_size=7, sampling_ratio=2) ``` reference: 1. https://github.com/pytorch/vision/blob/master/torchvision/models/detection/faster_rcnn.py 2. https://discuss.pytorch.org/t/index-error-using-custom-backbone-on-fasterrcnn/79834/4 Co-authored-by: holly1238 <[email protected]>
1 parent 5080235 commit f9b5840

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

intermediate_source/torchvision_tutorial.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ way of doing it:
263263
# be [0]. More generally, the backbone should return an
264264
# OrderedDict[Tensor], and in featmap_names you can choose which
265265
# feature maps to use.
266-
roi_pooler = torchvision.ops.MultiScaleRoIAlign(featmap_names=[0],
266+
roi_pooler = torchvision.ops.MultiScaleRoIAlign(featmap_names=['0'],
267267
output_size=7,
268268
sampling_ratio=2)
269269

0 commit comments

Comments
 (0)