Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Size of input tensor in ReformatImage function #16

Closed
dattv opened this issue Jan 22, 2024 · 4 comments
Closed

Size of input tensor in ReformatImage function #16

dattv opened this issue Jan 22, 2024 · 4 comments
Assignees
Labels

Comments

@dattv
Copy link

dattv commented Jan 22, 2024

Hi all.

I'm wondering that input resolution of yolov5 is 3x672x672, but why in

matx::tensor_t<matx::matxFp16, 5> mInput1 = matx::make_tensor<matx::matxFp16>((matx::matxFp16*)src[0], {1, 16, 672, 672, 1});
, the shape of mInput1 tensor was allocated as (1x16x672x672). (in case of using fp16)
anybody known why???
@zerollzeng, @mchi-zg

@zerollzeng zerollzeng self-assigned this Jan 27, 2024
@zerollzeng
Copy link
Collaborator

Because DLA takes chw16 inputs, which means we need to pad the input to NC/16HW16 first.

@dattv
Copy link
Author

dattv commented Jan 28, 2024

Because DLA takes chw16 inputs, which means we need to pad the input to NC/16HW16 first.

@zerollzeng Thank you for your feedback!,
however there are some extra information I want to inquires,

  • Did you means 16 in chw16 is 16 Bit?
  • Because the image included 3 channel (RGB) so i thought the mInput1 tensor must be something like 1x3x672x672*sizeof(half)?
  • Is there any different between memory size of cuda variables and dla variables?

@zerollzeng
Copy link
Collaborator

No, the 16 means the C channel is padded to 16, So you actually have a 1x16x672x672 tensor, while only the first 3 channels represent the image.

@lynettez
Copy link
Collaborator

lynettez commented Sep 2, 2024

closing since no activity for several month, thanks all!

@lynettez lynettez closed this as completed Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants