class_docstr: A collection of options that are passed to the training script
  and can be saved to perform inference later.
  
  Args:
    task: Name of the training task class.
    task_params: A dictionary of parameters passed to the training task.
docstr: Loads options from the given model directory.
  
  Args:
    model_dir: Path to the model directory.
docstr_tok: ["Loads","options","from","the","given","model","directory",".","Args",":","model_dir",":","Path","to","the","model","directory","."]
code: def load(model_dir):
      """Loads options from the given model directory.
  
      Args:
        model_dir: Path to the model directory.
      """
      with gfile.GFile(TrainOptions.path(model_dir), "rb") as file:
          options_dict = json.loads(file.read().decode("utf-8"))
      options_dict = defaultdict(None, options_dict)
  
      return TrainOptions(
          model_class=options_dict["model_class"],
          model_params=options_dict["model_params"],
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from __future__ import unicode_literals
  import inspect
  import os
  from collections import defaultdict
  from pydoc import locate
  import json
  import tensorflow
  from tensorflow import gfile
  from seq2seq.contrib import rnn_cell
label_desc: Use image node_id 6 for calling the TrainOptions obj's underlying member method code with example usage: obj.load(model_dir) and returns: TrainOptions