# Create the Timeline object, and write it to a json file
      fetched_timeline = timeline.Timeline(run_metadata.step_stats)
      chrome_trace = fetched_timeline.generate_chrome_trace_format()
      with open(os.path.join(params.log_dir, 'timeline_01.json'), 'w') as f:
        f.write(chrome_trace)
      with open(os.path.join(params.log_dir, 'mem_info.json'), 'w') as f:
        f.write(str(run_metadata))

    else:
      loss_value, _ = sess.run([loss, train_op], feed_dict=feed_dict)

    if step % params.ckpt_save_steps == 0:
      model.save(saver, sess, params.log_dir, step)

    duration = time.time() - start_time
    print('step {:d} \t loss = {:.3f}, ({:.3f} sec/step)'.format(step, loss_value, duration))

  coord.request_stop()
  coord.join(threads)

if __name__ == '__main__':
  args = get_arguments()
  params = Params()
  params = load_json_to_params(params, args.json_path)
  params.dataset_directory = '/home/ddegeus/datasets/Cityscapes/training/'
  params.filelist_filepath = '/home/ddegeus/datasets/Cityscapes/training/panoptic/filenames.lst'

  params.is_training = True
  params.batch_norm_istraining = True
  print(params)
  train(params)
      class_colors = class_colors.astype(np.uint8) * np.expand_dims(edges_invert, axis=2) + np.expand_dims(
        edges_total, axis=2)

      img_obj = Image.fromarray(np.uint8(class_colors))

      ax.imshow(img_obj)
      plt.waitforbuttonpress(timeout=5)




if __name__ == '__main__':
  args = get_arguments()
  params = Params()
  params = load_json_to_params(params, args.json_path)
  params.dataset_directory = '/home/ddegeus/datasets/Cityscapes/validation/'
  params.filelist_filepath = '/home/ddegeus/datasets/Cityscapes/validation/panoptic/filenames.lst'
  params.is_training = False
  params.batch_norm_istraining = False
  params.num_steps_predict = params.num_steps_eval
  params.height_input = 512
  params.width_input = 1024
  params.Nb = 1

  predict(params)