From 252543fbb8a13a7e1542afdc56716b8546ad93f5 Mon Sep 17 00:00:00 2001 From: Oceania2018 Date: Wed, 27 Nov 2019 20:45:21 -0600 Subject: [PATCH] Fix import_meta_graph exception if variables is empty. --- docs/source/MnistInRnn.md | 5 +++++ src/TensorFlowNET.Core/Framework/meta_graph.cs | 3 ++- src/TensorFlowNET.Core/TensorFlow.Binding.csproj | 3 ++- src/TensorFlowNET.Core/Variables/variables.py.cs | 1 - 4 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 docs/source/MnistInRnn.md diff --git a/docs/source/MnistInRnn.md b/docs/source/MnistInRnn.md new file mode 100644 index 00000000..ce8a1390 --- /dev/null +++ b/docs/source/MnistInRnn.md @@ -0,0 +1,5 @@ +# Chapter. MNIST In RNN + +### Recurrent Neural Networks + +Recurrent Neural Networks (RNNs) are popular models that have shown great promise in sequential data classification task. The traditional neural network model cannot make the next prediction input based on the knowledge that has been learned before. \ No newline at end of file diff --git a/src/TensorFlowNET.Core/Framework/meta_graph.cs b/src/TensorFlowNET.Core/Framework/meta_graph.cs index d80e67b4..6182a3a9 100644 --- a/src/TensorFlowNET.Core/Framework/meta_graph.cs +++ b/src/TensorFlowNET.Core/Framework/meta_graph.cs @@ -142,7 +142,8 @@ namespace Tensorflow break; default: - throw new NotImplementedException("import_scoped_meta_graph_with_return_elements"); + Console.WriteLine($"Cannot identify data type for collection {col.Key}. Skipping."); + break; } } diff --git a/src/TensorFlowNET.Core/TensorFlow.Binding.csproj b/src/TensorFlowNET.Core/TensorFlow.Binding.csproj index f374a2fe..3cf5c23c 100644 --- a/src/TensorFlowNET.Core/TensorFlow.Binding.csproj +++ b/src/TensorFlowNET.Core/TensorFlow.Binding.csproj @@ -25,7 +25,8 @@ https://tensorflownet.readthedocs.io 3: Add tf.nn.rnn_cell.BasicRNNCell and tf.nn.dynamic_rnn. 4: Add EstimatorSpec. 5: Add rnn.static_rnn. -6: Add array_grad._SplitGrad(). +6: Add array_grad._SplitGrad(). +7: Fix import_meta_graph exception if variables is empty. 7.3 0.13.0.0 LICENSE diff --git a/src/TensorFlowNET.Core/Variables/variables.py.cs b/src/TensorFlowNET.Core/Variables/variables.py.cs index 818b324e..a9f91ff2 100644 --- a/src/TensorFlowNET.Core/Variables/variables.py.cs +++ b/src/TensorFlowNET.Core/Variables/variables.py.cs @@ -61,7 +61,6 @@ namespace Tensorflow public static List global_variables(string scope = null) { return ops.get_collection(tf.GraphKeys.GLOBAL_VARIABLES, scope); - } ///