Browse Source

Fixed #398, Recusive defualt session factory

tags/v0.12
Eli Belash 6 years ago
parent
commit
7a828c0d1f
2 changed files with 2 additions and 2 deletions
  1. +1
    -1
      src/TensorFlowNET.Core/Keras/backend.cs
  2. +1
    -1
      src/TensorFlowNET.Core/tensorflow.cs

+ 1
- 1
src/TensorFlowNET.Core/Keras/backend.cs View File

@@ -28,7 +28,7 @@ namespace Tensorflow.Keras
//Func<Array, bool> py_any = any;
//Func<double, double, double, IEnumerable<double>> py_slice = slice;

public static Session _SESSION = tf.defaultSession;
public static Session _SESSION = ops.get_default_session();
public static Graph _GRAPH = null;
public static Dictionary<Graph, GraphLearningPhase> _GRAPH_LEARNING_PHASES;
//Dictionary<Graph, Dictionary<string, int>> PER_GRAPH_LAYER_NAME_UIDS;


+ 1
- 1
src/TensorFlowNET.Core/tensorflow.cs View File

@@ -40,7 +40,7 @@ namespace Tensorflow

public tensorflow()
{
_defaultSessionFactory = new ThreadLocal<Session>(Session);
_defaultSessionFactory = new ThreadLocal<Session>(() => new Session());
}

public Session defaultSession => _defaultSessionFactory.Value;


Loading…
Cancel
Save