I have successfully converted EfficientTAM to TensorRT (from ONNX) thanks for the tips @okideal in #7 , but I am seeing a very strange issue with the image_encoder if I use trtexec with --fp16. It degrades the accuracy by A LOT when --fp16 is used. This is the first time I am seeing this with a model converted to --fp16 (normally the accuracy degrades, but by a negligible margin).
To confirm this was indeed because of --fp16, I have built it with the normal (fp32) and --fp16. I also set the LayerNorm nodes and their inputs/outputs to trt.DataType.FLOAT of the --fp16 model, but still no luck. It seems that if I set all of the layers containing blocks in the name to trt.DataType.FLOAT, it works fine (but that is basically the whole image encoder).
Here are some screenshots of the accuracy degradation (on a still image):
| FP16 version |
FP32 version |
 |
 |
@yformer Do you know what might be the issue with converting the image encoder weights to FP16 ?
@okideal Did you encounter similar issues with your setup or did you just leave it in fp32?
I have successfully converted EfficientTAM to TensorRT (from ONNX) thanks for the tips @okideal in #7 , but I am seeing a very strange issue with the image_encoder if I use
trtexecwith--fp16. It degrades the accuracy by A LOT when--fp16is used. This is the first time I am seeing this with a model converted to--fp16(normally the accuracy degrades, but by a negligible margin).To confirm this was indeed because of
--fp16, I have built it with the normal (fp32) and--fp16. I also set theLayerNormnodes and their inputs/outputs totrt.DataType.FLOATof the--fp16model, but still no luck. It seems that if I set all of the layers containingblocksin the name totrt.DataType.FLOAT, it works fine (but that is basically the whole image encoder).Here are some screenshots of the accuracy degradation (on a still image):
@yformer Do you know what might be the issue with converting the image encoder weights to FP16 ?
@okideal Did you encounter similar issues with your setup or did you just leave it in fp32?