You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you very much for this wonderful library. It is really useful. I have trained the fastai unet model with ResNet34 as backbone and try to port it to C++ at the moment (and perhaps later, convert it to torch_tensorrt). So, for the step to compile the TorchScript module, torch.jit.script() is used. However, this function returns a failure.
RuntimeError: Hook 'hook_fn' on module 'ReLU' was expected to only have exactly 3 inputs but it had 4 inputs. This error occured while scripting the forward hook 'hook_fn' on module ReLU. If you did not want to script this hook remove it from the original NN module before scripting. This hook was expected to have the following signature: hook_fn(self, input: Tuple[Tensor], output: Tensor). The type of the output arg is the returned type from either the forward method or the previous hook if it exists. Note that hooks can return anything, but if the hook is on a submodule the outer module is expecting the same return type as the submodule's forward.
Further, I get the same error when trying to compile the model using torch_tensorrt. Can you help with creating the TorchScript? Thanks!
The text was updated successfully, but these errors were encountered:
Hello all,
Thank you very much for this wonderful library. It is really useful. I have trained the fastai unet model with ResNet34 as backbone and try to port it to C++ at the moment (and perhaps later, convert it to torch_tensorrt). So, for the step to compile the TorchScript module, torch.jit.script() is used. However, this function returns a failure.
The code is as follows:
The error obtained:
Further, I get the same error when trying to compile the model using
torch_tensorrt
. Can you help with creating the TorchScript? Thanks!The text was updated successfully, but these errors were encountered: