<p>If you need the inception distance, then you can use a less generic function called <code>tf.contrib.gan.eval.frechet_inception_distance</code> which doesn't ask for a <code>classifier_fn</code> argument:</p>

<pre><code>fid = tf.contrib.gan.eval.frechet_inception_distance(real_images, fake_images)
</code></pre>

<p>However, when I had tried to use this function using <code>v1.14</code> with eager execution mode, I got errors of various kinds. So eventually, I've decided to go with a custom solution. Probably it would be helpful for you as well.</p>

<p>I encountered the following implementation by <a href="https://machinelearningmastery.com" rel="nofollow noreferrer">Jason Brownlee</a> that seems to match the description from the original paper:</p>

<pre class="lang-py prettyprint-override"><code>import numpy as np
import scipy.linalg
import tensorflow as tf
import tensorflow.keras as keras
from tensorflow.keras.applications.inception_v3 import InceptionV3, preprocess_input
from tensorflow.compat.v1 import ConfigProto
from skimage.transform import resize


tf.enable_eager_execution()
config = ConfigProto()
config.gpu_options.allow_growth = True
tf.keras.backend.set_session(tf.Session(config=config))


def scale_images(images, new_shape):
    return np.asarray([resize(image, new_shape, 0) for image in images])


def calculate_fid(model, images1, images2):
    f1, f2 = [model.predict(im) for im in (images1, images2)]
    mean1, sigma1 = f1.mean(axis=0), np.cov(f1, rowvar=False)
    mean2, sigma2 = f2.mean(axis=0), np.cov(f2, rowvar=False)
    sum_sq_diff = np.sum((mean1 - mean2)**2)
    cov_mean = scipy.linalg.sqrtm(sigma1.dot(sigma2))
    if np.iscomplexobj(cov_mean):
        cov_mean = cov_mean.real
    fid = sum_sq_diff + np.trace(sigma1 + sigma2 - 2.0*cov_mean)
    return fid


if __name__ == '__main__':
    input_shape = (299, 299, 3)

    inception = InceptionV3(include_top=False, pooling='avg', input_shape=input_shape)

    (dataset, _), _ = keras.datasets.cifar10.load_data()
    dataset = dataset[:100]
    dataset = scale_images(dataset, input_shape)

    noise = preprocess_input(np.clip(255*np.random.uniform(size=dataset.shape), 0, 255))
    noise = scale_images(noise, input_shape)

    print('FID:', calculate_fid(inception, dataset, noise))
</code></pre>

<p>So we're performing the following steps:</p>

<ol>
<li><p>re-scale images to the shape expected by <code>InceptionV3</code>;</p></li>
<li><p>transform the images using <code>inception_v3.preprocess_input</code>;</p></li>
<li><p>pass both tensors through <code>InceptionV3</code> network (without top layer);</p></li>
<li><p>use the formula <a href="https://arxiv.org/pdf/1706.08500.pdf" rel="nofollow noreferrer">from the original paper</a> with the computed features as input parameters.</p></li>
</ol>

<hr>

<blockquote>
  <p>Here is an excerpt from the mentioned paper.</p>
</blockquote>

<p><a href="https://i.stack.imgur.com/9gUDE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9gUDE.png" alt="enter image description here"></a></p>
Fréchet Inception Distance parameters choice in Tensorflow?
<p>How to choose the value of classifier_fn in tensorflow, I couldn't find any example about it:</p>

<pre><code>         tf.contrib.gan.eval.frechet_classifier_distance(
                     real_images,
                     generated_images,
                     classifier_fn,
                     num_batches=1
</code></pre>

<p>)</p>