tensorflow / tensorflow/models

InceptionV3 graph has tensor absence from ckpt

Open
#7,808 1 comment 0 reactions 2 assignees View on GitHub

@marksandler2 is already working on this.

Since Jun 19, 2020.

models:research type:support
Dominant language
Python
Stars
77.7k
Forks
44.8k
PR merge metrics
No merged PRs in 30d

Description

System information
  • What is the top-level directory of the model you are using:
  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow): Yes
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): MacOS Sierra 10.12.6
  • TensorFlow installed from (source or binary): pypi (binary i suppose?)
  • TensorFlow version (use command below): v1.15.0-rc3-22-g590d6eef7e 1.15.0
  • Bazel version (if compiling from source): -
  • CUDA/cuDNN version: no gpu
  • GPU model and memory: no gpu
  • Exact command to reproduce: see Source code part
Describe the problem

I just download the pre-train model, and try to restore it. error raised as follow, and reproducible case is provided too.

ckpt download from this page
md5 of the inception_v3_2016_08_28.tar.gz: 0b7c5aaf2203128c5eb6216f3e25813c
md5 of the inception_v3.ckpt: 5fd07d9834fe14479e4da82df9365ede

NotFoundError (full traceback in the last)

NotFoundError: Tensor name "InceptionV3/AuxLogits/Conv2d_2a_3x3/BatchNorm/beta" not found in checkpoint files ./tmp/CBIR/inception_v3.ckpt
my assumption?

I have used print_tensors_in_checkpoint_file to check all tensors in the .ckpt file, and there is no Tensor named like Conv2d_2a_3x3/BatchNorm/beta

I assume this is because somehow the implement of inception from tensorflow.contrib.slim.python.slim.nets does not match with the pre-trained model ?

maybe this implement has dropped 3x3 kernel while the model is outdated?

Source code / logs
reproducible case
from tensorflow.contrib.slim.python.slim.nets import inception
from tensorflow.contrib import slim
import tensorflow as tf
# ckpt download from https://github.com/tensorflow/models/blob/master/research/slim/README.md#pre-trained-models
# md5 of the inception_v3_2016_08_28.tar.gz: 0b7c5aaf2203128c5eb6216f3e25813c
# md5 of the inception_v3.ckpt: 5fd07d9834fe14479e4da82df9365ede
ckpt_fp = "./tmp/CBIR/inception_v3.ckpt"  
g = tf.Graph()
with g.as_default():
    sess = tf.Session(graph=g)
    input_image = tf.placeholder(dtype=tf.float32, shape=[None, 244, 244, 3], name="input")
    with slim.arg_scope(inception.inception_v3_arg_scope()):
        logits, end_points = inception.inception_v3(input_image, is_training=False)
    f_vec = end_points['PreLogits']  # (N, 2048)
    saver = tf.train.Saver()
    saver.restore(sess, ckpt_fp)
Traceback

traceback.txt

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.