Thanks for the update and the code snippet.
The nn.Identity() approach might work, but looks quite hacky given the new code snippet.
However, I’m not familiar with the model, so don’t know which approach would be best to make is scriptable and would suggest to create an issue in their GitHub.



 WaterKnight:

However, the model works fast with first image. If we pass an image again it never ends! In addition, TorchScript model is also slower at first image.


I understand that the eager model is working for a single iteration and hangs in the second one?
While the scripted model is slower in the first iteration and works fine afterwards?