Hi, sure I can help you!
in u2net_test.py write this after net.eval():
scripted = torch.jit.script(net)
torch.jit.save(scripted, "fod.p")

This is how I build the model I use on Android. On iOS however, this model didn’t work so I used the following conversion method:
In u2net_test.py, in the loop which goes through the test images, write this after inputs_test is loaded:
if traced == False:
    traced_script_module = torch.jit.trace(net, inputs_test)
    traced_script_module.save("fod_traced.p")
    traced = True

Use traced boolean to only trace a single inference, not all the inferences.
Hope it helps.
If you need help with how to use these models on Android or iOS, let me know.