Run multiple pre-trained Tensorflow nets at the same time

后端 未结 2 1467
悲&欢浪女
悲&欢浪女 2020-12-14 14:11

What I would like to do is to run multiple pre-trained Tensorflow nets at the same time. Because the names of some variables inside each net can be the same, the common solu

2条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-14 14:37

    I have the same problem that bothered me a long time. I found a good solution here: Loading two models from Saver in the same Tensorflow session and TensorFlow checkpoint save and read.

    The default behavior for a tf.train.Saver() is to associate each variable with the name of the corresponding op. This means that each time you construct a tf.train.Saver(), it includes all of the variables for the previous calls. Therefore, you should create different graphs and run different sessions with them.

提交回复
热议问题