# deeplearning4j-examples: a Maven tour of the DL4J stack for JVM developers

> The official example repository for Eclipse Deeplearning4J is a set of separate Maven projects covering the high-level DL4J API, SameDiff, DataVec pipelines, Keras and TensorFlow import, Spark training and CUDA work. Here is what each project contains, how to build one, and where the examples stop being useful.

**deeplearning4j/deeplearning4j-examples** — Deeplearning4j Examples (DL4J, DL4J Spark, DataVec)

- Repository: https://github.com/deeplearning4j/deeplearning4j-examples
- Website: http://deeplearning4j.konduit.ai
- Stars: 2,505 · Forks: 1,808
- Language: Java
- License: NOASSERTION
- Published: 2026-09-28 · Updated: 2026-09-28 · Language: en
- Canonical page: https://hysenlabs.com/projects/deeplearning4j-deeplearning4j-examples

## What deeplearning4j-examples is, and who it is written for

This repository is not a library. It is a collection of separate Maven Java projects, each with its own pom.xml, that demonstrate the Eclipse Deeplearning4J ecosystem on the JVM. The README frames the ecosystem as covering the whole path of a JVM deep learning application: loading and preprocessing raw data, then building and tuning networks. The intended reader is a Java developer who has chosen that ecosystem and wants working code rather than prose.

The examples are grouped by capability, not by which library in the stack implements them. The top-level entries include dl4j-examples for the high-level API, samediff-examples, nd4j-ndarray-examples, data-pipeline-examples, tensorflow-keras-import-examples, onnx-import-examples, dl4j-distributed-training-examples, cuda-specific-examples, android-examples and oreilly-book-dl4j-examples. A mvn-project-template directory holds a minimal pom.xml for starting a clean project. If you are evaluating whether to adopt DL4J at all, the useful signal here is breadth: the same repository shows import paths for Keras h5 and TensorFlow frozen pb models, distributed training on Apache Spark, and multi-GPU data-parallel training.

## How the DL4J stack is split across the example projects

The README describes five components, and the example projects map onto them. DL4J is the high-level API for MultiLayerNetworks and ComputationGraphs, with custom layers and Keras h5 import including tf.keras models as of 1.0.0-M2. ND4J is the linear algebra layer, documented as over 500 mathematical, linear algebra and deep learning operations, sitting on the C++ LibND4J codebase with CPU (AVX2/512) and CUDA acceleration through OpenBLAS, OneDNN, cuDNN and cuBLAS. SameDiff lives inside ND4J and is the automatic differentiation framework, using a define-then-run graph approach; the README compares the SameDiff API against the DL4J API as the analogue of low-level TensorFlow against Keras. DataVec is the ETL layer for HDFS, Spark, images, video, audio, CSV and Excel. LibND4J is the C++ base, and the README points at JavaCPP for how the JVM reaches native arrays and operations.

That split explains the directory layout. Importing a Keras model is not a DL4J-API exercise, so it has its own project. Writing a custom layer or loss function is a SameDiff exercise. Getting a CSV or image set into a format the network can consume is DataVec. Each subproject README lists its examples and a recommended order, so the repository is a set of curricula rather than one linear tutorial.

## Building a first example with Maven

The README states that the repository consists of several separate Maven Java projects, each with its own pom files, and that build tools matter here because the dependency graph of the DL4J ecosystem is too difficult to manage by hand. It also points to the simple sample project at mvn-project-template/pom.xml for starting from scratch. So the first step is to pick a subproject and read its own README, not the top-level one.

The repository is on GitHub under deeplearning4j/deeplearning4j-examples. Because the projects are separate Maven builds, you work inside one subproject directory at a time. The README does not print a build command, but Maven's standard lifecycle applies to a directory containing a pom.xml, and the README links to the Maven configuration documentation at deeplearning4j.konduit.ai/config/maven:

```bash
cd dl4j-examples
mvn clean package
```

The README does not document an expected build output, a runtime, or a target directory, so treat the first build as a dependency-resolution exercise: what you should confirm is that Maven resolves the DL4J artifacts named in that subproject's pom.xml and compiles the example classes. If you would rather start a clean project than read someone else's, the README points at the template:

```bash
cd mvn-project-template
mvn clean package
```

For platform and hardware questions, the README states that all projects in the ecosystem support Windows, Linux and macOS, with CUDA GPUs 10.0, 10.1 and 10.2 (except on macOS), x86 CPU (x86_64, avx2, avx512), ARM (arm, arm64, armhf) and PowerPC (ppc64le). It does not give per-example run instructions at the top level.

## Imported models, Spark training and CUDA: the three specialised tracks

Three subprojects deserve separate attention because they answer different questions.

tensorflow-keras-import-examples shows how to bring Keras h5 models and TensorFlow frozen pb models into the ecosystem. The README's description of the payoff is explicit: once imported, the model is treated like any other DL4J model, so you can keep training it, modify it through the transfer learning API, or run inference. That is the practical answer to the question of whether an existing Python-trained model can be reused in a Java service.

onnx-import-examples sits alongside it. The README says ONNX import is planned rather than shipped, which is worth reading carefully before assuming the directory means full ONNX support.

dl4j-distributed-training-examples covers training, inference and evaluation on Apache Spark. The README states that DL4J distributed training uses a hybrid asynchronous SGD approach and links to the distributed deep learning documentation for detail. cuda-specific-examples covers multi-GPU data-parallel training, which is a performance-oriented track rather than a modelling one.

## Where the examples stop being enough

The clearest limitation is stated by the project itself. The README carries a note for users of 1.0.0-beta7 and prior: some examples and modules have been removed to reflect changes in the framework's direction, with a link to a community post about module removals and roadmap changes. If you find a blog post or a Stack Overflow answer referencing an example that is no longer here, that is why. The repository does not claim to be a historical archive.

A second gap is support. The README says the project does not monitor GitHub issues on this repository very often and directs users to community.konduit.ai. That changes the cost of adoption: a broken example is a forum question, not a tracked issue.

A third is scope. SameDiff is described as supporting TensorFlow frozen .pb import, with ONNX, TensorFlow SavedModel and Keras import listed as planned, and eager graph execution also listed as planned. Anyone whose plan depends on those paths should treat them as future work rather than available features. Finally, the examples demonstrate APIs; the README does not present them as production templates, and nothing in it documents deployment, serving or operational concerns.

## deeplearning4j-examples against the Python-first path

The comparison people actually make is against PyTorch and TensorFlow used directly from Python. The difference is not modelling capability, it is where the code runs. The DL4J ecosystem is built so that a JVM application can own the whole pipeline: DataVec handles ETL from HDFS, Spark, images, video, audio, CSV and Excel, ND4J supplies the array operations, and DL4J or SameDiff supplies the network. If your serving layer is already Java, that removes a language boundary and keeps one build tool in play.

The trade-off is ecosystem gravity. The README's own framing of SameDiff as the analogue of low-level TensorFlow against Keras is a useful calibration: the higher-level DL4J API is the Keras-like surface, and the lower-level graph API is more explicit. Model import is the bridge in the other direction, and it is one-way in practice. Keras h5 and TensorFlow frozen pb come in; the README does not describe exporting DL4J models back out to those formats. Teams that train in Python and serve in Java should plan on the import path, not round-tripping.

## Maintenance, licensing and what the repository does not say

The repository is not archived, and the last push was on 2026-07-16. That is recent enough that the example set has not been abandoned, but the README's own support note matters more than the push date for planning: it states that GitHub issues here are not monitored very often and routes users to community.konduit.ai, and it points to a community post about module removals and roadmap changes. Neither the README nor the repository metadata describes a release cadence for the examples themselves.

On licensing: the repository carries LICENSE.txt and NOTICE.txt, and the metadata reports the licence as NOASSERTION, meaning no standard identifier was detected. The README does not discuss licensing, and nothing here should be read as legal advice. If you intend to copy example code into a product, read LICENSE.txt and NOTICE.txt yourself and check what they say about the DL4J artifacts your pom.xml pulls in, which are separate from this repository. Upgrade cost is mostly dependency management: because each subproject has its own pom.xml, bumping DL4J versions means editing several files rather than one, and the mvn-project-template is the only place the README points to for a clean starting configuration.

## Conclusion

Adopt this repository if you already write Java and want to see the DL4J high-level API, SameDiff, DataVec and Spark training wired together in compilable code, starting from the dl4j-examples quickstart set. Do not adopt it as a Python-to-Java bridge or as a maintained tutorial for every layer the framework has ever shipped: the README states that some examples and modules were removed for users of 1.0.0-beta7 and prior, and points to a community post about module removals and roadmap changes. Verify first that the artifact versions in the pom.xml you intend to build match the DL4J release you want, then open the README inside the subproject you picked, because each one lists its own examples and a recommended order.

## FAQ

### What is deeplearning4j-examples in Java?

It is the official example repository for the Eclipse Deeplearning4J ecosystem, made of several separate Maven Java projects. Each project demonstrates a different part of the stack, such as the high-level DL4J API, SameDiff, DataVec pipelines or Spark training.

### How do I run the deeplearning4j-examples?

Clone the repository, change into one of the subproject directories such as dl4j-examples, and build it with Maven, since each project has its own pom.xml. The README does not list per-example run instructions at the top level; each subproject README lists its examples and a recommended order.

### Does deeplearning4j-examples cover importing Keras or TensorFlow models?

Yes. The tensorflow-keras-import-examples project demonstrates importing Keras h5 models and TensorFlow frozen pb models, after which the README says they can be treated like any other DL4J model for continued training, transfer learning or inference.

### Where should I ask for help with these examples?

The README directs users to the support forum at community.konduit.ai and states that GitHub issues on this repository are not monitored very often.

## Sources

- [deeplearning4j/deeplearning4j-examples on GitHub](https://github.com/deeplearning4j/deeplearning4j-examples)
- [Issues](https://github.com/deeplearning4j/deeplearning4j-examples/issues)
- [Project website](http://deeplearning4j.konduit.ai)
- [README](https://github.com/deeplearning4j/deeplearning4j-examples/blob/master/README.md)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/deeplearning4j-deeplearning4j-examples
