NVIDIA / NVIDIA/TensorRT

extract a slice of tensor with dynamic batch size

Open
#3,216 6 comments 0 reactions 1 assignee View on GitHub

@zerollzeng is already working on this.

Since Aug 14, 2023.

triaged
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.