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:
- Go to
dl4j-labs/src/main/java/ai/certifai/solution/feedforward/detectgender/PredictGenderTrain.java
- Run the java file to train the model.
- Go to
dl4j-labs/src/main/java/ai/certifai/solution/feedforward/detectgender/PredictGenderTest.java
- 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

Desktop:
- OS: Windows 10 Pro
- Version: 10.0.19042 Build 19042
Describe the bug
java.lang.IndexOutOfBoundsExceptionoccurs 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:
cdle-traininglabs/dl4j-labs/src/main/java/ai/certifai/solution/feedforward/detectgender/PredictGenderTest.java
Lines 91 to 94 in 725a6e4
To Reproduce
Steps to reproduce the behavior:
dl4j-labs/src/main/java/ai/certifai/solution/feedforward/detectgender/PredictGenderTrain.javadl4j-labs/src/main/java/ai/certifai/solution/feedforward/detectgender/PredictGenderTest.javaExpected behavior
No error occurs, successfully predict the gender from the name.
Screenshots

Desktop: