Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

What are the steps to migrate my TF trained model to the NCSv1?


  • 14 Comments sorted by Votes Date Added
  • What is going on my post is just blank and it quite big why i dont see my post?

  • My post are showing blank, no idea why so ill do multicomments:

    I know people have asked this already but i dont seem to find the real steps as everybody goes in a different way or i dont understart A.I good enough :sweat_smile:

    So i used tensorflow 1.9 to train my model, i am using the (legacy) and also tried with (new script) both located in the .../research/object_detection folder from Tensorflow.
    When training finishes a frozen graph is generated but i dont understand why that one doesnt work.
    I am using SSD_inceptionV2_coco latest release on tf github. The trained model works great using just tensorflow code but if i tried to get the GRAPH file for the NCS it fails everytime, i am just not able to find the input and output nodes that work properly, there is alot on the internet to get those but i dont think i am doing it write.

    I followed this guide:
    But it seems it works only for the models in ncappzoo, i tried the commands in the site and worked fine. so i could get the GRAPH file. my ssd_inceptionv2_coco failed :(
    So i check this link:

    But the code dont seem to work with the model.ckpt-200000

  • This is my code:
    import numpy as np
    import tensorflow as tf

    from tensorflow.contrib.slim.nets import inception

    slim = tf.contrib.slim

    def run(name, image_size, num_classes):
    with tf.Graph().as_default():
    image = tf.placeholder("float", [1, image_size, image_size, 3], name="input")
    with slim.arg_scope(inception.inception_v1_arg_scope()):
    logits, _ = inception.inception_v1(image, num_classes, is_training=False, spatial_squeeze=False)
    probabilities = tf.nn.softmax(logits)
    init_fn = slim.assign_from_checkpoint_fn('model.ckpt-200000', slim.get_model_variables('InceptionV2'))

    with tf.Session() as sess:
        saver = tf.train.Saver(tf.global_variables()), "output/"+name)

    run('inception-v2', 299, 2)

    I just dont know what to use for model variables, InceptionV2 gets me

  • -------------------------------------------------------------------OUTPUT1----------------------------------------------------------------------------------------------------------------
    Traceback (most recent call last):
    File "", line 21, in
    run('inception-v2', 299, 2)
    File "", line 14, in run
    init_fn = slim.assign_from_checkpoint_fn('model.ckpt-200000', slim.get_model_variables('InceptionV2'))
    File "/home/chop/.local/lib/python2.7/site-packages/tensorflow/contrib/framework/python/ops/", line 678, in assign_from_checkpoint_fn
    raise ValueError('var_list cannot be empty')
    ValueError: var_list cannot be empty

  • ---------------------------------------------------------------------OUTPUT2---------------------------------------------------------------------------------------------------------------
    i tried InceptionV1 and worked a bit better but i know that is not the option for sure:

    2019-01-05 04:41:01.150820: I tensorflow/core/platform/] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
    2019-01-05 04:41:01.220727: I tensorflow/stream_executor/cuda/] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
    2019-01-05 04:41:01.221057: I tensorflow/core/common_runtime/gpu/] Found device 0 with properties:
    name: GeForce GTX 970 major: 5 minor: 2 memoryClockRate(GHz): 1.342
    pciBusID: 0000:01:00.0
    totalMemory: 3.94GiB freeMemory: 3.40GiB
    2019-01-05 04:41:01.221070: I tensorflow/core/common_runtime/gpu/] Adding visible gpu devices: 0
    2019-01-05 04:41:01.398357: I tensorflow/core/common_runtime/gpu/] Device interconnect StreamExecutor with strength 1 edge matrix:
    2019-01-05 04:41:01.398383: I tensorflow/core/common_runtime/gpu/] 0
    2019-01-05 04:41:01.398388: I tensorflow/core/common_runtime/gpu/] 0: N
    2019-01-05 04:41:01.398500: I tensorflow/core/common_runtime/gpu/] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 3121 MB memory) -> physical GPU (device: 0, name: GeForce GTX 970, pci bus id: 0000:01:00.0, compute capability: 5.2)

  • i just cant post the output what is going on? moderators please check this!

  • So what am i missing? do i need to move to OpenVino? in order for this to work?
    Do i need to train my model with tf_slim as mandatory step for NCSv1?
    What am i missing? i have been using pretrained models with the NCSv1 and it work great for my security cameras, now i want to automate my house but i need a custom model but i just cant make it work with NCS. using a desktop is just to much resources for a smarthouse and alot of power and money as i might need the Nvidia card. So please allow me to keep playing with this device. love it.

  • If you came for answers, stop using the NCSDK and switch to OpenVINO.
    After that i was able to use the and test it on one of the samples with my NCSv1 using the web documentation, is way better than NCS docs and very well done same as the OpenVINO SDK.

Sign In or Register to comment.