0

I have two models with the exact same architecture, but different weights as the same network is used for two different problems. We're using TF-TRT to optimize the model in order to use it on edge devices.

We'd like to be able to switch from one model to the other as fast as possible. As of now, we load the next model using tf.saved_model.load(), however, this reloads the entire model including the architecture. In order to speed up the process, we'd like to simply load the weights & switch them in the model architecture.

From what I've seen, it is possible in Keras by loading a .w1 file, but we don't have such file after converting to TF-TRT. I've found out that TRT has a Refitter object but I don't think we can use it in this case.

I'd like to know if it is possible to switch weights of a TF-TRT model, perhaps there is something I'm missing out.

Thank you for your help.

nachomendi
  • 51
  • 2
  • 6

0 Answers0