{"action":"created","issue":{"url":"https://api.github.com/repos/tensorflow/tensorflow/issues/212","labels_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/212/labels{/name}","comments_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/212/comments","events_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/212/events","html_url":"https://github.com/tensorflow/tensorflow/issues/212","id":116869296,"number":212,"title":"Multiple models in one session","user":{"login":"cinjon","id":615351,"avatar_url":"https://avatars.githubusercontent.com/u/615351?v=3","gravatar_id":"","url":"https://api.github.com/users/cinjon","html_url":"https://github.com/cinjon","followers_url":"https://api.github.com/users/cinjon/followers","following_url":"https://api.github.com/users/cinjon/following{/other_user}","gists_url":"https://api.github.com/users/cinjon/gists{/gist_id}","starred_url":"https://api.github.com/users/cinjon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cinjon/subscriptions","organizations_url":"https://api.github.com/users/cinjon/orgs","repos_url":"https://api.github.com/users/cinjon/repos","events_url":"https://api.github.com/users/cinjon/events{/privacy}","received_events_url":"https://api.github.com/users/cinjon/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"vrv","id":463737,"avatar_url":"https://avatars.githubusercontent.com/u/463737?v=3","gravatar_id":"","url":"https://api.github.com/users/vrv","html_url":"https://github.com/vrv","followers_url":"https://api.github.com/users/vrv/followers","following_url":"https://api.github.com/users/vrv/following{/other_user}","gists_url":"https://api.github.com/users/vrv/gists{/gist_id}","starred_url":"https://api.github.com/users/vrv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vrv/subscriptions","organizations_url":"https://api.github.com/users/vrv/orgs","repos_url":"https://api.github.com/users/vrv/repos","events_url":"https://api.github.com/users/vrv/events{/privacy}","received_events_url":"https://api.github.com/users/vrv/received_events","type":"User","site_admin":false},"milestone":null,"comments":3,"created_at":"2015-11-13T22:50:05Z","updated_at":"2015-11-19T00:24:14Z","closed_at":null,"body":"Is this possible? I'm doing something where I need the outputs of multiple distinct models to be compared. To do that, I'm batching up inputs and running them over each model. It's unclear to me how I can do this in one session."},"comment":{"url":"https://api.github.com/repos/tensorflow/tensorflow/issues/comments/157907689","html_url":"https://github.com/tensorflow/tensorflow/issues/212#issuecomment-157907689","issue_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/212","id":157907689,"user":{"login":"cinjon","id":615351,"avatar_url":"https://avatars.githubusercontent.com/u/615351?v=3","gravatar_id":"","url":"https://api.github.com/users/cinjon","html_url":"https://github.com/cinjon","followers_url":"https://api.github.com/users/cinjon/followers","following_url":"https://api.github.com/users/cinjon/following{/other_user}","gists_url":"https://api.github.com/users/cinjon/gists{/gist_id}","starred_url":"https://api.github.com/users/cinjon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cinjon/subscriptions","organizations_url":"https://api.github.com/users/cinjon/orgs","repos_url":"https://api.github.com/users/cinjon/repos","events_url":"https://api.github.com/users/cinjon/events{/privacy}","received_events_url":"https://api.github.com/users/cinjon/received_events","type":"User","site_admin":false},"created_at":"2015-11-19T00:24:14Z","updated_at":"2015-11-19T00:24:14Z","body":"```\r\ndef create_model(session, forward_only, model_dir=None,\r\n                 source_vocab_size=None, target_vocab_size=None, \r\nlayer_size=None, num_layers=None,\r\n                 max_gradient_norm=None, batch_size=None,\r\n                 learning_rate=None, learning_rate_decay_factor=None):\r\n  \"\"\"Create model and initialize parameters in session.\"\"\"      \r\n  model = Seq2SeqModel(\r\n    vocab_size, vocab_size, bucket_sizes, layer_size, num_layers,\r\n    max_gradient_norm, batch_size, learning_rate, learning_rate_decay_factor,\r\n    forward_only=forward_only)\r\n                                   \r\n  model_dir = model_dir or FLAGS.model_dir\r\n  ckpt = tf.train.get_checkpoint_state(model_dir)\r\n  if ckpt and gfile.Exists(ckpt.model_checkpoint_path):\r\n    print \"Reading model parameters from %s\" % ckpt.model_checkpoint_path\r\n    model.saver.restore(session, ckpt.model_checkpoint_path)\r\n  else:\r\n    print \"Created model with fresh parameters.\"\r\n    session.run(tf.variables.initialize_all_variables())\r\n  return model\r\n```\r\n"}}