Skip to content

mnist.Train.GetNextBatch Exception #1

Closed

Description

@xuwaters

https://github.com/SciSharp/TensorFlow.NET-Examples/blob/24ed42b65bddc655b575532b7089d28aa5b07642/src/TensorFlowNET.Examples/BasicModels/LogisticRegression.cs#L92

When running LogisticRegression Example, I got an Exception:

System.InvalidOperationException: Can't construct NDCoordinatesIncrementor with an empty shape.
   at NumSharp.Utilities.NDCoordinatesIncrementor..ctor(Shape& shape)
   at NumSharp.NDArray._extract_indices(NDArray[] mindices, Boolean isCollapsed, NDArray out)
   at Tensorflow.Hub.MnistDataSet.GetNextBatch(Int32 batch_size, Boolean fake_data, Boolean shuffle)
   at TensorFlowNET.Examples.LogisticRegression.Run() in TensorFlow.NET-Examples/src/TensorFlowNET.Examples/BasicModels/LogisticRegression.cs:line 92
   at TensorFlowNET.Examples.Program.Main(String[] args) in TensorFlow.NET-Examples/src/TensorFlowNET.Examples/Program.cs:line 75

A fix to this example could be modifying this line to the following:

var start = i * batch_size;
var end = (i + 1) * batch_size;
var (batch_xs, batch_ys) = mnist.GetNextBatch(mnist.Train.Data, mnist.Train.Labels, start, end);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions