create_session

tfsnippet.utils.create_session(lock_memory=True, log_device_placement=False, allow_soft_placement=True, **kwargs)

A convenient method to create a TensorFlow session.

Parameters:
  • lock_memory (True or False or float) –
    • If True, lock all free memory.
    • If False, set allow_growth to True, i.e., not to lock
      all free memory.
    • If float, lock this portion of memory.

    (default None)

  • log_device_placement (bool) – Whether to log the placement of graph nodes. (default False)
  • allow_soft_placement (bool) – Whether or not to allow soft placement? (default True)
  • **kwargs – Other named parameters to be passed to tf.ConfigProto.
Returns:

The TensorFlow session.

Return type:

tf.Session