Open vogaliccb opened 1 year ago
Looks like a usage issue to me, I would suggest using Polygraphy so that you don't need to implement the calibrator.
A sample usage:
polygraphy convert model.onnx --int8 --data-loader-script ./data_loader.py --calib-base-cls IInt8EntropyCalibrator2 -o model.plan --calibration-cache model.cache
But I cannot install polygraphy in AGX drive Orin X
How to use multi input calibrator in C++? Because I use Int8EntropyCalibrator2 when network has 1 input is OK
I have a sample of python code may could help you, give me your email so i can send you this sample.
I have a sample of python code may could help you, give me your email so i can send you this sample.
Thank you! rainwish@alumni.sjtu.edu.cn
I have a sample of python code may could help you, give me your email so i can send you this sample.
I use the python code, but still have this problem
I have a sample of python code may could help you, give me your email so i can send you this sample.
i would like to have a try, could you please send the sample to me ? thanks!
I have a sample of python code may could help you, give me your email so i can send you this sample.
i would like to have a try, could you please send the sample to me ? thanks!
1017255004@qq.com
did you guys finally solve the problem? I meet a similar problem when using python api:
def get_batch(names):
try:
# Assume self.batches is a generator that provides batch data.
data = next(self.batches)
# Assume that self.device_input is a device buffer allocated by the constructor.
cuda.memcpy_htod(self.device_input, data)
return [int(self.device_input)]
except StopIteration:
# When we're out of batches, we return either [] or None.
# This signals to TensorRT that there is no calibration data remaining.
return None
just don't know how to arrange multi-input, I suppose it's OK when there is single input. And I tried polygraphy, which works fine, but lack of flexibility like when you want to assign the precision of some layers.
@zerollzeng I have a same problem, can you help me, please?
Description
When I use IInt8EntropyCalibrator2, there are 7 input. so I cudaMemcpy 7 input to bindings in Int8EntropyCalibrator2::getBatch
like:
but it report :
How to solve this problem? One input is OK!
Environment
TensorRT Version: 8.5.10 CUDA 11.4