This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Importing Inception tensorflow model issue



Hi,

I am trying to import Inception V1 tensorflow model validated by TI itself(Refer user guide TIDeepLearningLibrary_UserGuide- 3.6.5 Importing Tensorflow Models) from below github:

From above I got " inception_v1.ckpt " file and I have referred below thread to convert ckpt to the frozen graph:

But that Inception model have only .ckpt file so I need other files(.ckpt.meta, .ckpt.index) with that, to generate .pb file or else like Mobilenet ( )do you have any script for Inception to generate .pb file.
If so, then please share with me else please guide to generate inceptionnet_v1.pb file.

  • Please use the attached code as a reference for freezing checkpoint file with a model file

        network_fn = nets_factory.get_network_fn(
            FLAGS.model_name,
            num_classes=(dataset.num_classes - FLAGS.labels_offset),
            weight_decay=FLAGS.weight_decay,
            is_training=False)
                    
            
        with tf.Graph().as_default() as graph:         
          input = tf.placeholder(name="input", shape=[1,infer_image_height,infer_image_width,3], dtype=tf.float32)    
          logits,end_points = network_fn(input)
          #predictions = tf.argmax(logits, 1)
          
          saver = tf.train.Saver()      
          sess = tf.Session(graph=graph)
          init = tf.global_variables_initializer()
          sess.run(init)
          
          if tf.gfile.IsDirectory(FLAGS.checkpoint_path):
            checkpoint_path = tf.train.latest_checkpoint(FLAGS.checkpoint_path)
          else: 
            checkpoint_path = FLAGS.checkpoint_path
          
          saver.restore(sess, checkpoint_path)
    
          
          tf.train.write_graph(sess.graph.as_graph_def(), FLAGS.output_path,
                               'graph-for-inference.pb', as_text=False)           
          
          freeze_graph.freeze_graph(FLAGS.output_path+'/graph-for-inference.pb', '', True, 
              checkpoint_path, output_node_names=FLAGS.output_names, 
              restore_op_name='save/restore_all', output_graph=FLAGS.output_path+'/graph-for-inference-frozen.pb', 
              clear_devices=False, filename_tensor_name="input:0", initializer_nodes=None, variable_names_blacklist=None)     
    

    Also you refer below

    #stackoverflow.com/.../39476154