A Deep Java Library MNIST CNN example for AI Tech Education
- Install JDK 11:
sudo apt-get install openjdk-11-jdk
- Clone DJL repository:
git clone https://github.com/deepjavalibrary/djl
- Download and copy
TrainMnistCNN.java
from repository:https://github.com/davor10105/djl_aitech
to ai.djl.examples.training and the inference fileImageClassificationCNN.java
to ai.djl.examples.inference - Move to examples directory
djl/examples
- Run the training:
./gradlew run -Dmain=ai.djl.examples.training.TrainMnistCNN
- Run the inference:
./gradlew run -Dmain=ai.djl.examples.training.ImageClassificationCNN
- Download and copy
TrainCARPK.java
from repository:https://github.com/davor10105/djl_aitech
to ai.djl.examples.training, the dataset loader fileCARPKDetection.java
to ai.djl/basicdataset/src/main/java/ai/djl/basicdataset/cv/ and the CARPK (carpk directory) dataset to djl/basicdataset/src/test/resources/mlrepo/dataset/cv/ai/djl/basicdataset/ - Move to examples directory
djl/examples
- Run the training:
./gradlew run -Dmain=ai.djl.examples.training.TrainCARPK
- Run inference.