4

The short version:

I would like to visualize a keras model in lucid, and fail to transform the model into a format lucid would accept.

The long version:

I would like to play around with lucid exploring a simple model built in keras (CNN for MNIST like this one https://www.tensorflow.org/tutorials).

The tutorial for importing models into lucid here https://colab.research.google.com/drive/1PPzeZi5sBN2YRlBmKsdvZPbfYtZI-pHl#scrollTo=3YKffRa70uGm

tells me I need a "frozen graph". So I followed this tutorial

https://towardsdatascience.com/freezing-a-keras-model-c2e26cb84a38 ,

transformed the keras model into a tf estimator, trained it and applied the freeze_graph() method provided in the tutorial.

But the resulting graph does not seem to have an input node lucid can use - I assume because the estimator the graph is based on expects an input function instead of a tensor as input?

Is there a way to adapt this graph so it accepts regular tf tensors as input?

Alternatively, is there another way to train & save a keras model as a frozen graph without going the detour over the tf estimators?

Peter
  • 41
  • 1

0 Answers0