Closed BrettRyland closed 1 year ago
Note: I've been able to partially work around this (partially because I'm getting a different issue afterwards) by modifying torchvision/ops
with
diff -x __pycache__ /home/brett/github/torchvision/torchvision/ops/ps_roi_align.py /home/brett/.local/lib/python3.10/site-packages/torchvision/ops/ps_roi_align.py
2a3
> from torch.jit.annotations import BroadcastingList2
13c14
< output_size: int,
---
> output_size: BroadcastingList2[int],
67c68
< output_size: int,
---
> output_size: BroadcastingList2[int],
diff -x __pycache__ /home/brett/github/torchvision/torchvision/ops/roi_align.py /home/brett/.local/lib/python3.10/site-packages/torchvision/ops/roi_align.py
59c59,61
< if not isinstance(rois, torch.Tensor):
---
> if isinstance(rois, torch.Tensor):
> pass
> else:
diff -x __pycache__ /home/brett/github/torchvision/torchvision/ops/_utils.py /home/brett/.local/lib/python3.10/site-packages/torchvision/ops/_utils.py
29c29,31
< if isinstance(boxes, (list, tuple)):
---
> if isinstance(boxes, torch.Tensor):
> assert boxes.size(1) == 5, "The boxes tensor shape is not correct as Tensor[K, 5]"
> elif isinstance(boxes, (list, tuple)):
34,35d35
< elif isinstance(boxes, torch.Tensor):
< assert boxes.size(1) == 5, "The boxes tensor shape is not correct as Tensor[K, 5]"
so it looks like something is messed up with isinstance
for tensors.
As a temporary work-around while this and other issues are getting fixed, is it possible to tell torch_tensorrt.compile
to ignore certain sections of the model? E.g., to compile the backbone of the network, but leave the rest as scripted or traced?
As a temporary work-around while this and other issues are getting fixed, is it possible to tell
torch_tensorrt.compile
to ignore certain sections of the model? E.g., to compile the backbone of the network, but leave the rest as scripted or traced?
I see that the torch_executed_modules
is intended for this, but I haven't been able to get it to work. How does one specify these modules?
E.g., in this simple script trt_bug4.py everything always gets compiled despite all the variants I'm passing to torch_executed_modules
.
This issue has not seen activity for 90 days, Remove stale label or comment or this will be closed in 10 days
This issue has not seen activity for 90 days, Remove stale label or comment or this will be closed in 10 days
Bug Description
torchvision.ops.roi_align
is throwing an internal assert failure when compiling a model using it withtorch_tensorrt.compile
.To Reproduce
Repro script: trt_bug3.py
Expected behavior
Expected graph compilation to succeed.
Environment
TensorRT is built from 91a92ca4 with PR #1067 merged in