Closed DaraOrange closed 1 year ago
Int8 and fp16 can be enabled at the same time. No extra flags are required.
But why does problem with softmax appear then?
Enlarge the max workspace size might help.
My config:
backend_config = dict(
type='tensorrt',
common_config=dict(
fp16_mode=True, int8_mode=True, max_workspace_size=2147483648),
model_inputs=[
dict(
input_shapes=dict(
input=dict(
min_shape=[1, 3, 320, 320],
opt_shape=[1, 3, 800, 1344],
max_shape=[1, 3, 1344, 1344])))
])
calib_config = dict(create_calib=True, calib_file='calib_data.h5')
I think, workspace size is maximum (1<<31)
internimage is extremely large. I am afraid 2Gb workspace might not be enough.
I try to convert tiny version of InternImage. What do you think, which size is enough?
I even tried 1<<50, the same problem with softmax
This issue is marked as stale because it has been marked as invalid or awaiting response for 7 days without any further response. It will be closed in 5 days if the stale label is not removed or if there is no further response.
This issue is closed because it has been stale for 5 days. Please open a new issue if you have similar issues or you have any new updates now.
I have meet the same problem. Enlarge the max workspace size is not help. Is the problem solved?Can you give me some advice, thanks. @DaraOrange @RunningLeon @grimoire
Checklist
Describe the bug
I'm trying to convert my model to int8, but it fails because of Softmax (it is not implemented in int8). I'm trying to enable PREFER_PRECISION_CONSTRAINTS flag for builder, but it has no effect. What should I do to automatically fallback such layers in fp16 (converting all model to fp16 is correct)?
Reproduction
MODEL="mask_rcnn_internimage_t_fpn_3x_coco" CKPT_PATH="/home/dara-orange/workdir/scripts/checkpoints/mask_rcnn_internimage_t_fpn_3x_coco.pth"
python deploy.py \ "./deploy/configs/mmdet/instance-seg/instance-seg_tensorrt_dynamic-320x320-1344x1344.py" \ "./configs/coco/${MODEL}.py" \ "${CKPT_PATH}" \ "../../../data/Retinaface/many_people_fast_frames/1.jpg" \ --work-dir "../checkpoints/${MODEL}_no_mask_int8.trt" \ --device cuda \ --dump-info \ --quant
Environment
Error traceback