I tried to force the compilation by ignoring all the hooks. It compiled, but the inference does not work (pink squares on my output instead of the picture expected).
I don’t have the time to dig into the DynamicUnet implementation for now saddly 
Just in case you want to try with different models, here is the SO thread ( https://stackoverflow.com/questions/56242857/how-can-i-force-torch-jit-trace-to-compule-my-module-by-ignoring-hooks/56242858#56242858 44 )