Skip to content

IndexOutOfBoundsException in PredictGenderTest #175

@TINGWEIJING

Description

@TINGWEIJING

Describe the bug
java.lang.IndexOutOfBoundsException occurs when user input more than 11 characters (space included) in the input field.
Affected in both solution and training folder.

Code that causes this error:

for (int i = 0; i < arr.length; i++)
{
features.putScalar(new int[]{0, i}, Integer.parseInt(arr[i]));
}

To Reproduce
Steps to reproduce the behavior:

  1. Go to dl4j-labs/src/main/java/ai/certifai/solution/feedforward/detectgender/PredictGenderTrain.java
  2. Run the java file to train the model.
  3. Go to dl4j-labs/src/main/java/ai/certifai/solution/feedforward/detectgender/PredictGenderTest.java
  4. Run the java file and enter the name with more than 11 characters in input field.

Expected behavior
No error occurs, successfully predict the gender from the name.

Screenshots
image

Desktop:

  • OS: Windows 10 Pro
  • Version: 10.0.19042 Build 19042

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions