(model_dir)
return [model_params, eval_model_params, sample_model_params]
Loads model for inference mode, used in jupyter notebook.
Loads model for inference mode, used in jupyter notebook.
Loads model for inference mode used in jupyter notebook .
def load_model(model_dir):
  """Loads model for inference mode, used in jupyter notebook."""
  model_params = sketch_rnn_model.get_default_hparams()
  with tf.gfile.Open(os.path.join(model_dir, 'model_config.json'), 'r') as f:
    model_params.parse_json(f.read())

  model_params.batch_size = 1  # only sample one at a time
  eval_model_params = sketch_rnn_model.copy_hparams(model_params)
  eval_model_params.use_input_dropout = 0
  eval_model_params.use_recurrent_dropout = 0
  eval_model_params.use_output_dropout = 0
  eval_model_params.is_training = 0
  sample_model_params = sketch_rnn_model.copy_hparams(eval_model_params)
  sample_model_params.max_seq_len = 1  # sample one point at a time
  return [model_params, eval_model_params, sample_model_params]
def load_model ( model_dir ) : model_params = sketch_rnn_model . get_default_hparams ( ) with tf . gfile . Open ( os . path . join ( model_dir , 'model_config.json' ) , 'r' ) as f : model_params . parse_json ( f . read ( ) ) model_params . batch_size = 1 # only sample one at a time eval_model_params = sketch_rnn_model . copy_hparams ( model_params ) eval_model_params . use_input_dropout = 0 eval_model_params . use_recurrent_dropout = 0 eval_model_params . use_output_dropout = 0 eval_model_params . is_training = 0 sample_model_params = sketch_rnn_model . copy_hparams ( eval_model_params ) sample_model_params . max_seq_len = 1 # sample one point at a time return [ model_params , eval_model_params , sample_model_params ]