Browse Source

Fix batch_size for Keras Input.

tags/v0.100.4-load-saved-model
Haiping Chen 3 years ago
parent
commit
0a08386ca9
3 changed files with 4 additions and 0 deletions
  1. +1
    -0
      src/TensorFlowNET.Core/Keras/Layers/ILayersApi.cs
  2. +2
    -0
      src/TensorFlowNET.Keras/Layers/LayersApi.cs
  3. +1
    -0
      src/python/xor_keras.py

+ 1
- 0
src/TensorFlowNET.Core/Keras/Layers/ILayersApi.cs View File

@@ -108,6 +108,7 @@ namespace Tensorflow.Keras.Layers
public ILayer GlobalMaxPooling2D(string data_format = "channels_last");

public Tensors Input(Shape shape,
int batch_size = -1,
string name = null,
bool sparse = false,
bool ragged = false);


+ 2
- 0
src/TensorFlowNET.Keras/Layers/LayersApi.cs View File

@@ -469,6 +469,7 @@ namespace Tensorflow.Keras.Layers
/// </param>
/// <returns>A tensor.</returns>
public Tensors Input(Shape shape,
int batch_size = -1,
string name = null,
bool sparse = false,
bool ragged = false)
@@ -476,6 +477,7 @@ namespace Tensorflow.Keras.Layers
var input_layer = new InputLayer(new InputLayerArgs
{
InputShape = shape,
BatchSize= batch_size,
Name = name,
Sparse = sparse,
Ragged = ragged


+ 1
- 0
src/python/xor_keras.py View File

@@ -4,6 +4,7 @@ import tensorflow as tf

os.environ["CUDA_VISIBLE_DEVICES"] = "-1"
print(tf.__version__)
# https://playground.tensorflow.org/
# tf.compat.v1.enable_eager_execution()
# tf.debugging.set_log_device_placement(True);
tf.config.run_functions_eagerly(True)


Loading…
Cancel
Save