Closed abcnorio closed 1 week ago
I wrote what to do in my readme. Your input precision is wrong. Input precision (by default the same as the onnx precision) and model precision (the arguments you specify in trtexec
) are two different things.
clip = vs.core.resize.Bicubic(clip, format=vs.RGBH, matrix_in_s="709") # RGBS means fp32, RGBH means fp16
On Tue, 24 Sep 2024 18:31:14 -0700 sudo @.***> wrote:
yes thanks that's obvious, but is there a reason? Going on the vapoursynth page it lists RGBH but without any technical explanation what this is, the net does not know a fp16 RGBH format. One would expect 24 or 32 bit based on (2^8)^3 RGB values. Such things have to be documented where they appear (this is not meant for you, but for vapoursynth). So the problem here is the vapoursynth part?
Question: How does it decide which format the tensorrt uses? It is obviously not the model precision so the model creation call is unrelated to that, correct assumption?
How to find that out?
thx for a hint where to get those infos. Often there are "trivial" things not documented properly that are the cause for delays. I had a similar issues with fine-tuning and data set prep for upscaling where the gt_size was not properly documented and only later one finds out "en passent" that the internal engine crops a little bit more so this is not related to the previous cropping part to prep training images. One sentence would be enough.
Thanks and best!
I wrote what to do in my readme. Your input precision is wrong. Input precision and model precision are two different things.
clip = vs.core.resize.Bicubic(clip, format=vs.RGBH, matrix_in_s="709") # RGBS means fp32, RGBH means fp16
-- Reply to this email directly or view it on GitHub: https://github.com/styler00dollar/VSGAN-tensorrt-docker/issues/82#issuecomment-2372688691 You are receiving this because you authored the thread.
Message ID: @.***>
without any technical explanation what this is
The terminology "Single" and "Half" refers to IEEE 754.
It doesn't seem to be written in the vapoursynth documentation.
How does it decide which format the tensorrt uses?
By default the input precision is the onnx model precision, if the onnx is fp16 then the input will be fp16, but you can customize it with trtexec
arguments.
--inputIOFormats=spec Type and format of each of the input tensors (default = all inputs in fp32:chw)
See --outputIOFormats help for the grammar of type and format list.
Note: If this option is specified, please set comma-separated types and formats for all
inputs following the same order as network inputs ID (even if only one input
needs specifying IO format) or set the type and format once for broadcasting.
--outputIOFormats=spec Type and format of each of the output tensors (default = all outputs in fp32:chw)
Note: If this option is specified, please set comma-separated types and formats for all
outputs following the same order as network outputs ID (even if only one output
needs specifying IO format) or set the type and format once for broadcasting.
IO Formats: spec ::= IOfmt[","spec]
IOfmt ::= type:fmt
type ::= "fp32"|"fp16"|"bf16"|"int32"|"int64"|"int8"|"uint8"|"bool"
fmt ::= ("chw"|"chw2"|"chw4"|"hwc8"|"chw16"|"chw32"|"dhwc8"|
"cdhw32"|"hwc"|"dla_linear"|"dla_hwc4")["+"fmt]
To have fp16 input for a fp32 onnx, it would be --inputIOFormats=fp16:chw --outputIOFormats=fp16:chw
.
One sentence would be enough.
In my readme I wrote:
- If you use the FP16 onnx you need to use RGBH colorspace, if you use FP32 onnx you need to use RGBS colorspace in inference_config.py .
Isn't that enough?
On Fri, 27 Sep 2024 15:58:06 -0700 sudo @.***> wrote:
Honestly, this is pretty much clearer!
I have to think carefully and will send you a suggestion after reading all the links so that may be one sentence can be added as another explanation to your webpage. Shame on me I am not from the IT world so there are quite some things not always clear to me even if I read it carefully. But still I have to use the technology (we talk here of a voluntary area, not a professional commercial one).
best wishes and many thanks! Very appreciated !!
best wishes
without any technical explanation what this is
The terminology "Single" and "Half" refers to IEEE 754.
It doesn't seem to be written in the vapoursynth documentation.
How does it decide which format the tensorrt uses?
By default the input precision is the onnx model precision, if the onnx is fp16 then the input will be fp16, but you can customize it with
trtexec
arguments.--inputIOFormats=spec Type and format of each of the input tensors (default = all inputs in fp32:chw) See --outputIOFormats help for the grammar of type and format list. Note: If this option is specified, please set comma-separated types and formats for all inputs following the same order as network inputs ID (even if only one input needs specifying IO format) or set the type and format once for broadcasting. --outputIOFormats=spec Type and format of each of the output tensors (default = all outputs in fp32:chw) Note: If this option is specified, please set comma-separated types and formats for all outputs following the same order as network outputs ID (even if only one output needs specifying IO format) or set the type and format once for broadcasting. IO Formats: spec ::= IOfmt[","spec] IOfmt ::= type:fmt type ::= "fp32"|"fp16"|"bf16"|"int32"|"int64"|"int8"|"uint8"|"bool" fmt ::= ("chw"|"chw2"|"chw4"|"hwc8"|"chw16"|"chw32"|"dhwc8"| "cdhw32"|"hwc"|"dla_linear"|"dla_hwc4")["+"fmt]
To have fp16 input for a fp32 onnx, it would be
--inputIOFormats=fp16:chw --outputIOFormats=fp16:chw
.One sentence would be enough.
In my readme I wrote:
- If you use the FP16 onnx you need to use RGBH colorspace, if you use FP32 onnx you need to use RGBS colorspace in inference_config.py .
Isn't that enough?
-- Reply to this email directly or view it on GitHub: https://github.com/styler00dollar/VSGAN-tensorrt-docker/issues/82#issuecomment-2380252304 You are receiving this because you authored the thread.
Message ID: @.***>
Hello,
the build went fine, but did not find some libs that physically were there, and therefor did not work out. Will separately post that, till then tried to use via
docker pull
thestyler00dollar/vsgan_tensorrt:latest_no_avx512 1c70b0b0ce36
GPU is a rtx 4090, cpu is Intel(R) Core(TM) i9-14900, OS Debian trixie, Docker version 26.1.5+dfsg1, build a72d7cd
input video file (originally SVHS):
output with error:
Used the following model and converted as outlined (no problems) to
model.engine
RealESRGANv2-animevideo-xsx2.onnx
with
trtexec --bf16 --fp16 --onnx=RealESRGANv2-animevideo-xsx2.onnx --minShapes=input:1x3x8x8 --optShapes=input:1x3x720x1280 --maxShapes=input:1x3x1080x1920 --saveEngine=model.engine --tacticSources=+CUDNN,-CUBLAS,-CUBLAS_LT --skipInference --useCudaGraph --noDataTransfers --builderOptimizationLevel=5
inference.py
andinference_config.py
are with default values, just changed the video input:inference.py
inference_config.py
So what's the problem? Some filter to apply before actually applying the
trt model
? Wrong colorspace? Thanks!