title: Error when profiling keras models
body: <p>I want to profile my Keras model according to this <a href="https://github.com/tensorflow/tensorflow/issues/9868" rel="nofollow noreferrer">comment on github</a>. I use the tf.Keras API with Tensorflow version: 1.9.0-rc2 and Keras version: 2.1.6-tf.</p>
  
  <pre><code>run_options = tf.RunOptions(trace_level=tf.RunOptions.FULL_TRACE)
  run_metadata = tf.RunMetadata()
  
  training_set = load_datasets(...) 
  model.compile(loss=helpers.mean_categorical_crossentropy,optimizer='adam',options=run_options,run_metadata=run_metadata)
  model.fit(training_set.make_one_shot_iterator(), steps_per_epoch=steps_per_epoch_train,epochs=num_epochs, verbose=2)
  
  trace = timeline.Timeline(step_stats=run_metadata.step_stats)
  with open('timeline.ctf.json', 'w') as f:
      f.write(trace.generate_chrome_trace_format())
  </code></pre>
  
  <p>Error</p>
  
  <blockquote>
    <p>('Some keys in session_kwargs are not supported at this time: %s',
    dict_keys(['options', 'run_metadata']))</p>
  </blockquote>
  
  <p>In another <a href="https://github.com/keras-team/keras/issues/6606" rel="nofollow noreferrer">github post</a> someone gives this example and somehow it runs without errors. I however get the same error as above.</p>
  
  <pre><code>import keras
  from keras.layers.core import Dense
  from keras.models import Sequential
  import tensorflow as tf
  from tensorflow.python.client import timeline
  import numpy as np
  
  x = np.random.randn(10000, 2)
  y = (x[:, 0] * x[:, 1]) &gt; 0 # xor
  run_options = tf.RunOptions(trace_level=tf.RunOptions.FULL_TRACE)
  run_metadata = tf.RunMetadata()
  model = Sequential()
  model.add(Dense(units=64, activation='relu', input_dim=2))
  model.add(Dense(units=2, activation='softmax'))
  model.compile(loss='categorical_crossentropy',
                optimizer='sgd',
                options=run_options,
                run_metadata=run_metadata)
  model.fit(x, keras.utils.to_categorical(y), epochs=1)
  trace = timeline.Timeline(step_stats=run_metadata.step_stats)
  with open('timeline.ctf.json', 'w') as f:
      f.write(trace.generate_chrome_trace_format())
  </code></pre>
  
  <p>I also found this <a href="https://github.com/tensorflow/tensorflow/issues/19911" rel="nofollow noreferrer">issue</a> on github which suggests that profiling with Keras models isn't implemented yet. I am confused.</p>
  
  <p>Does anybody know how to fix it?</p>