FEARTracker
FEARTracker copied to clipboard
How to convert model to TRT
Hello again. as you mentioned in the another issue, i tried to convert your model to TRT with torch2trt. here is a part of my code: dummy_input_to_model_init_encoder = torch.ones((1, 3, 128, 128)).cuda() dummy_input_to_model_update_search = torch.ones((1, 3, 256, 256)).cuda() model_encoder_update = torch2trt(model, [dummy_input_to_model_update_search, dummy_input_to_model_init_encoder])
after execution i got the following error: TypeError: forward() takes 2 positional arguments but 3 were given.
how to fix it?
well i finally converted model to trt but gives me this error: [TensorRT] ERROR: 4: (Unnamed Layer* 325) [Convolution]: count of 2304 weights in kernel, but kernel dimensions (3,3) with 256 input channels, 256 output channels and 1 groups were specified. Expected Weights count is 256 * 3*3 * 256 / 1 = 589824
also after converting model with torch2trt, model's accuracy drops heavily. why??!!
Hi
[TensorRT] ERROR: 4: (Unnamed Layer* 325) [Convolution]: count of 2304 weights in kernel, but kernel dimensions (3,3) with 256 input channels, 256 output channels and 1 groups were specified. Expected Weights count is 256 * 3*3 * 256 / 1 = 589824
Model runs correctly in PyTorch, so any errors in other runtimes come from the wrong conversion between runtimes. Make sure you didn't make errors in the model while converting it. I haven't tried converting FEAR to TensorRT using torch2trt. Try this TensorRT compiler for PyTorch, I converted FEAR to TensorRT using it a while ago.
also after converting model with torch2trt, model's accuracy drops heavily
It means your model is converted incorrectly. TensorRT should have the same accuracy if you convert all layers properly
@t-martyniuk When can you release the code?