tensorflowpython-importtf-slim

Why use "slim = tf.contrib.slim" instead of import slim normally?


In most tensorflow slim tutorials, slim module is loaded using,

slim = tf.contrib.slim

it does not seem making any difference (am I missing anything?), if I do

from tensorflow.contrib import slim

Is there any particular reason that we want to use 'slim = tf.contrib.slim' instead of 'import'?


Solution

  • There isn't a difference between the

    slim = tf.contrib.slim
    

    and

    from tensorflow.contrib import slim
    

    I believe that the former is used to avoid writing the entire tensorflow name.