I have an agent that will play in a multi-agent environment, and I'd like that agent to play against other agents that have been previously trained. The model for each agent was saved using tf.train.Saver().

What is the neatest way to load the opponents models, bearing in mind each agent will (I suspect) need its own independent Session and graph, otherwise I'll end up with duplicate model elements on the same graph and TensorFlow will throw an error.

It seems rather clunky to need lots of graphs and sessions, so I was wondering if there was a neater way to achieve this?

  • $\begingroup$ I don't know the whole answer, but you could probably avoid the "duplicate model elements" problem by putting each agent's model in a different variable scope. $\endgroup$ – Philip Raeisghasem Mar 13 '19 at 23:36
  • $\begingroup$ I found the answer here. Basically yes, each agent will need its own graph and session and there's no way around that because that's how TensorFlow operates, but the above certainly helped in the way to construct that mechanism to do that. $\endgroup$ – BigBadMe Mar 14 '19 at 12:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.