extract a slice of tensor with dynamic batch size
@zerollzeng is already working on this.
Since Aug 14, 2023.
- Dominant language
- C++
- Stars
- 13.4k
- Forks
- 2.4k
- Avg merge
- 5d 3h
- Merged PRs (30d)
- 2
Description
Description
I'm trying to extract a slice from the YOLO output with a dynamic batch size (-1), but the ISliceLayer cannot accept -1 as a shape value.
auto batch_size = -1;
Dims3 shapes{batch_size, network->getOutput(0)->getDimensions().d[1], 4};
auto box_layer = network->addSlice(*network->getOutput(0), {1, 1, 1}, shapes, {0, 0, 0});
auto result = network->addShuffle(*box_layer->getOutput(0));
result->setReshapeDimensions(Dims4{batch_size, 1, 1, 4});
i got the error:
FTL: [graphShapeAnalyzer.cpp::addVolumeCheck::877] Error Code 9: Internal Error ((Unnamed Layer* 665) [Slice]_output: dimension 0 never exceeds -1)
FTL: 4: (Unnamed Layer* 665) [Slice]: mismatch in number of dimensions for start.
FTL: 4: [network.cpp::validate::3121] Error Code 4: Internal Error (Layer (Unnamed Layer* 665) [Slice] failed validation)
How can I solve this issue?
Environment
TensorRT 8.6.1.6
Cuda 12.0
Driver Version: 525.105.17
Operating System:
ubuntu 18.04
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.