title: NameError:name 'create_model' is not defined ....i have tried importing model from keras but it hasnt solved it .how to solve?
body: <p>I tried creating a model using tensorflow. When I tried executing it shows me  <img src="https://i.stack.imgur.com/kkugn.png" alt="this"></p>
  
  <p>the other files are in this link------- github.com/llSourcell/tensorflow_chatbot </p>
  
  <pre><code>def train():
  
      enc_train, dec_train=data_utils.prepare_custom_data(
          gConfig['working_directory'])
      train_set = read_data(enc_train,dec_train)
  
  def seq2seq_f(encoder_inputs,decoder_inputs,do_decode):
      return tf.nn.seq2seq.embedding_attention_seq2seq(
          encoder_inputs,decoder_inputs, cell,
          num_encoder_symbols=source_vocab_size,
          num_decoder_symbols=target_vocab_size,
          embedding_size=size,
          output_projection=output_projection,
          feed_previous=do_decode)
  
  with tf.Session(config=config) as sess:
      model = create_model(sess,False)
  
      while True:
          sess.run(model)
  
          checkpoint_path = os.path.join(gConfig['working_directory'],'seq2seq.ckpt')
          model.saver.save(sess, checkpoint_path, global_step=model.global_step)
  
  </code></pre>
  
  <p>other than this the other python files ive used are in the github link specified in the comments section below</p>
  
  <p>this is the code defining create_model in the execute.py file</p>
  
  <pre><code>
  def create_model(session, forward_only):
  
    """Create model and initialize or load parameters"""
    model = seq2seq_model.Seq2SeqModel( gConfig['enc_vocab_size'], gConfig['dec_vocab_size'], _buckets, gConfig['layer_size'], gConfig['num_layers'], gConfig['max_gradient_norm'], gConfig['batch_size'], gConfig['learning_rate'], gConfig['learning_rate_decay_factor'], forward_only=forward_only)
  
    if 'pretrained_model' in gConfig:
        model.saver.restore(session,gConfig['pretrained_model'])
        return model
  
    ckpt = tf.train.get_checkpoint_state(gConfig['working_directory'])
    # the checkpoint filename has changed in recent versions of tensorflow
    checkpoint_suffix = ""
    if tf.__version__ &gt; "0.12":
        checkpoint_suffix = ".index"
    if ckpt and tf.gfile.Exists(ckpt.model_checkpoint_path + checkpoint_suffix):
      print("Reading model parameters from %s" % ckpt.model_checkpoint_path)
      model.saver.restore(session, ckpt.model_checkpoint_path)
    else:
      print("Created model with fresh parameters.")
      session.run(tf.initialize_all_variables())
    return model
  </code></pre>