How to use the new generated DL4J artifact in DL4J-examples project?

@yaoyao your console output doesn’t show that though. It says M2.1 right in the console output. Can you show me your full pom rather than what you think I need to see?

This is my pom in DL4J-EXAMPLES project:

<?xml version="1.0" encoding="UTF-8"?>


4.0.0

<groupId>org.deeplearning4j</groupId>
<artifactId>dl4j-examples</artifactId>
<version>1.0.0-SNAPSHOT</version>
<name>Introduction to DL4J</name>
<description>A set of examples introducing the DL4J framework</description>

<properties>
    <!-- <dl4j-master.version>1.0.0-M2.1</dl4j-master.version> -->
    <dl4j-master.version>1.0.0-SNAPSHOT</dl4j-master.version>
    
    <!-- Change the nd4j.backend property to nd4j-cuda-X-platform to use CUDA GPUs -->
    <!-- <nd4j.backend>nd4j-cuda-10.2-platform</nd4j.backend> -->
    <nd4j.backend>nd4j-native</nd4j.backend>
    <java.version>1.8</java.version>
    <maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
    <maven.minimum.version>3.3.1</maven.minimum.version>
    <exec-maven-plugin.version>1.4.0</exec-maven-plugin.version>
    <maven-shade-plugin.version>2.4.3</maven-shade-plugin.version>
    <jcommon.version>1.0.23</jcommon.version>
    <jfreechart.version>1.0.13</jfreechart.version>
    <logback.version>1.1.7</logback.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <junit.version>5.8.0-M1</junit.version>
    <javacv.version>1.5.5</javacv.version>

</properties>


<repositories>
    <repository>
        <id>sonatype-nexus-snapshots</id>
        <name>Sonatype Nexus Snapshots</name>
        <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        <releases>
            <enabled>false</enabled>
        </releases>
        <snapshots>
            <enabled>true</enabled>
            <updatePolicy>daily</updatePolicy>  <!-- Optional, update daily -->
        </snapshots>
    </repository>



</repositories>

<dependencies>
    <dependency>
        <groupId>org.nd4j</groupId>
        <artifactId>${nd4j.backend}</artifactId>
        <version>${dl4j-master.version}</version>
    </dependency>

    <dependency>
        <groupId>org.datavec</groupId>
        <artifactId>datavec-api</artifactId>
        <version>${dl4j-master.version}</version>
    </dependency>
    <dependency>
        <groupId>org.datavec</groupId>
        <artifactId>datavec-data-image</artifactId>
        <version>${dl4j-master.version}</version>
    </dependency>
    <dependency>
        <groupId>org.datavec</groupId>
        <artifactId>datavec-local</artifactId>
        <version>${dl4j-master.version}</version>
    </dependency>
    <dependency>
        <groupId>org.deeplearning4j</groupId>
        <artifactId>deeplearning4j-datasets</artifactId>
        <version>${dl4j-master.version}</version>
    </dependency>
    <dependency>
        <groupId>org.deeplearning4j</groupId>
        <artifactId>deeplearning4j-core</artifactId>
        <version>${dl4j-master.version}</version>
    </dependency>

    <dependency>
        <groupId>org.deeplearning4j</groupId>
        <artifactId>resources</artifactId>
        <version>${dl4j-master.version}</version>
    </dependency>

    <dependency>
        <groupId>org.deeplearning4j</groupId>
        <artifactId>deeplearning4j-ui</artifactId>
        <version>${dl4j-master.version}</version>
    </dependency>
    <dependency>
        <groupId>org.deeplearning4j</groupId>
        <artifactId>deeplearning4j-zoo</artifactId>
        <version>${dl4j-master.version}</version>
    </dependency>
    <!-- ParallelWrapper & ParallelInference live here -->
    <dependency>
        <groupId>org.deeplearning4j</groupId>
        <artifactId>deeplearning4j-parallel-wrapper</artifactId>
        <version>${dl4j-master.version}</version>
    </dependency>
    <!-- Used in the feedforward/classification/MLP* and feedforward/regression/RegressionMathFunctions example -->
    <dependency>
        <groupId>jfree</groupId>
        <artifactId>jfreechart</artifactId>
        <version>${jfreechart.version}</version>
    </dependency>
    <dependency>
        <groupId>org.jfree</groupId>
        <artifactId>jcommon</artifactId>
        <version>${jcommon.version}</version>
    </dependency>
    <!-- Used for downloading data in some of the examples -->
    <dependency>
        <groupId>org.apache.httpcomponents</groupId>
        <artifactId>httpclient</artifactId>
        <version>4.3.5</version>
    </dependency>
    <dependency>
        <groupId>ch.qos.logback</groupId>
        <artifactId>logback-classic</artifactId>
        <version>${logback.version}</version>
    </dependency>

    <dependency>
        <groupId>org.bytedeco</groupId>
        <artifactId>javacv-platform</artifactId>
        <version>${javacv.version}</version>
    </dependency>

    <!-- Test dependency. Ignore for your own application. -->
    <dependency>
        <groupId>org.junit.jupiter</groupId>
        <artifactId>junit-jupiter-engine</artifactId>
        <version>${junit.version}</version>
        <scope>test</scope>
    </dependency>

    <dependency>
        <groupId>org.junit.jupiter</groupId>
        <artifactId>junit-jupiter-api</artifactId>
        <version>${junit.version}</version>
        <scope>test</scope>
    </dependency>



</dependencies>
<!-- Maven Enforcer: Ensures user has an up to date version of Maven before building -->
<build>
    <plugins>

        <plugin>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>3.0.0-M5</version>
            <inherited>true</inherited>
            <dependencies>
                <dependency>
                    <groupId>org.apache.maven.surefire</groupId>
                    <artifactId>surefire-junit-platform</artifactId>
                    <version>3.0.0-M5</version>
                </dependency>
            </dependencies>
        </plugin>

        <plugin>
            <artifactId>maven-enforcer-plugin</artifactId>
            <version>1.0.1</version>
            <executions>
                <execution>
                    <id>enforce-default</id>
                    <goals>
                        <goal>enforce</goal>
                    </goals>
                    <configuration>
                        <rules>
                            <requireMavenVersion>
                                <version>[${maven.minimum.version},)</version>
                                <message>********** Minimum Maven Version is ${maven.minimum.version}. Please upgrade Maven before continuing (run "mvn --version" to check). **********</message>
                            </requireMavenVersion>
                        </rules>
                    </configuration>
                </execution>
            </executions>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>${maven-compiler-plugin.version}</version>
            <configuration>
                <source>${java.version}</source>
                <target>${java.version}</target>
            </configuration>
        </plugin>

        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <version>${exec-maven-plugin.version}</version>
            <executions>
                <execution>
                    <goals>
                        <goal>exec</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <executable>java</executable>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-shade-plugin</artifactId>
            <version>${maven-shade-plugin.version}</version>
            <configuration>
                <shadedArtifactAttached>true</shadedArtifactAttached>
                <shadedClassifierName>${shadedClassifier}</shadedClassifierName>
                <createDependencyReducedPom>true</createDependencyReducedPom>
                <filters>
                    <filter>
                        <artifact>*:*</artifact>
                        <excludes>
                            <exclude>org/datanucleus/**</exclude>
                            <exclude>META-INF/*.SF</exclude>
                            <exclude>META-INF/*.DSA</exclude>
                            <exclude>META-INF/*.RSA</exclude>
                        </excludes>
                    </filter>
                </filters>
            </configuration>
            <executions>
                <execution>
                    <phase>package</phase>
                    <goals>
                        <goal>shade</goal>
                    </goals>
                    <configuration>
                        <transformers>
                            <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
                                <resource>reference.conf</resource>
                            </transformer>
                            <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
                            <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                            </transformer>
                        </transformers>
                    </configuration>
                </execution>
            </executions>
        </plugin>
    </plugins>
    <pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.eclipse.m2e</groupId>
                <artifactId>lifecycle-mapping</artifactId>
                <version>1.0.0</version>
                <configuration>
                    <lifecycleMappingMetadata>
                        <pluginExecutions>
                            <pluginExecution>
                                <pluginExecutionFilter>
                                    <groupId>com.lewisd</groupId>
                                    <artifactId>lint-maven-plugin</artifactId>
                                    <versionRange>[0.0.11,)</versionRange>
                                    <goals>
                                        <goal>check</goal>
                                    </goals>
                                </pluginExecutionFilter>
                                <action>
                                    <ignore/>
                                </action>
                            </pluginExecution>
                        </pluginExecutions>
                    </lifecycleMappingMetadata>
                </configuration>
            </plugin>
        </plugins>
    </pluginManagement>
</build>

The error is:

[INFO] Scanning for projects…
[INFO]
[INFO] ------------------< org.deeplearning4j:dl4j-examples >------------------
[INFO] Building Introduction to DL4J 1.0.0-SNAPSHOT
[INFO] from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
Downloading from google-maven-central: https://maven-central.storage-download.googleapis.com/maven2/org/bytedeco/ffmpeg/4.3.2-1.5.5/ffmpeg-4.3.2-1.5.5-android-arm64.jar
Downloading from google-maven-central: https://maven-central.storage-download.googleapis.com/maven2/org/bytedeco/ffmpeg/4.3.2-1.5.5/ffmpeg-4.3.2-1.5.5-android-arm.jar
Downloading from google-maven-central: https://maven-central.storage-download.googleapis.com/maven2/org/bytedeco/ffmpeg/4.3.2-1.5.5/ffmpeg-4.3.2-1.5.5-android-x86.jar
Downloading from google-maven-central: https://maven-central.storage-download.googleapis.com/maven2/org/bytedeco/ffmpeg/4.3.2-1.5.5/ffmpeg-4.3.2-1.5.5.jar
Downloading from google-maven-central: https://maven-central.storage-download.googleapis.com/maven2/org/bytedeco/ffmpeg-platform/4.3.2-1.5.5/ffmpeg-platform-4.3.2-1.5.5.jar
Downloaded from google-maven-central: https://maven-central.storage-download.googleapis.com/maven2/org/bytedeco/ffmpeg-platform/4.3.2-1.5.5/ffmpeg-platform-4.3.2-1.5.5.jar (3.1 kB at 2.0 kB/s)
Downloading from google-maven-central: https://maven-central.storage-download.googleapis.com/maven2/org/bytedeco/ffmpeg/4.3.2-1.5.5/ffmpeg-4.3.2-1.5.5-android-x86_64.jar
Downloaded from google-maven-central: https://maven-central.storage-download.googleapis.com/maven2/org/bytedeco/ffmpeg/4.3.2-1.5.5/ffmpeg-4.3.2-1.5.5.jar (319 kB at 146 kB/s)
Downloading from google-maven-central: https://maven-central.storage-download.googleapis.com/maven2/org/bytedeco/ffmpeg/4.3.2-1.5.5/ffmpeg-4.3.2-1.5.5-linux-x86.jar
Downloaded from google-maven-central: https://maven-central.storage-download.googleapis.com/maven2/org/bytedeco/ffmpeg/4.3.2-1.5.5/ffmpeg-4.3.2-1.5.5-android-x86.jar (15 MB at 4.7 MB/s)
Downloading from google-maven-central: https://maven-central.storage-download.googleapis.com/maven2/org/bytedeco/ffmpeg/4.3.2-1.5.5/ffmpeg-4.3.2-1.5.5-linux-x86_64.jar
Downloaded from google-maven-central: https://maven-central.storage-download.googleapis.com/maven2/org/bytedeco/ffmpeg/4.3.2-1.5.5/ffmpeg-4.3.2-1.5.5-android-arm64.jar (13 MB at 4.2 MB/s)
Downloading from google-maven-central: https://maven-central.storage-download.googleapis.com/maven2/org/bytedeco/ffmpeg/4.3.2-1.5.5/ffmpeg-4.3.2-1.5.5-linux-armhf.jar
Downloaded from google-maven-central: https://maven-central.storage-download.googleapis.com/maven2/org/bytedeco/ffmpeg/4.3.2-1.5.5/ffmpeg-4.3.2-1.5.5-linux-x86.jar (14 MB at 3.6 MB/s)
Downloading from google-maven-central: https://maven-central.storage-download.googleapis.com/maven2/org/bytedeco/ffmpeg/4.3.2-1.5.5/ffmpeg-4.3.2-1.5.5-linux-arm64.jar
Downloaded from google-maven-central: https://maven-central.storage-download.googleapis.com/maven2/org/bytedeco/ffmpeg/4.3.2-1.5.5/ffmpeg-4.3.2-1.5.5-android-x86_64.jar (14 MB at 3.3 MB/s)
Downloading from google-maven-central: https://maven-central.storage-download.googleapis.com/maven2/org/bytedeco/ffmpeg/4.3.2-1.5.5/ffmpeg-4.3.2-1.5.5-linux-ppc64le.jar
Downloaded from google-maven-central: https://maven-central.storage-download.googleapis.com/maven2/org/bytedeco/ffmpeg/4.3.2-1.5.5/ffmpeg-4.3.2-1.5.5-linux-x86_64.jar (14 MB at 2.9 MB/s)
Downloading from google-maven-central: https://maven-central.storage-download.googleapis.com/maven2/org/bytedeco/ffmpeg/4.3.2-1.5.5/ffmpeg-4.3.2-1.5.5-macosx-x86_64.jar
Downloaded from google-maven-central: https://maven-central.storage-download.googleapis.com/maven2/org/bytedeco/ffmpeg/4.3.2-1.5.5/ffmpeg-4.3.2-1.5.5-linux-armhf.jar (13 MB at 2.7 MB/s)
Downloading from google-maven-central: https://maven-central.storage-download.googleapis.com/maven2/org/bytedeco/ffmpeg/4.3.2-1.5.5/ffmpeg-4.3.2-1.5.5-windows-x86.jar
Downloaded from google-maven-central: https://maven-central.storage-download.googleapis.com/maven2/org/bytedeco/ffmpeg/4.3.2-1.5.5/ffmpeg-4.3.2-1.5.5-android-arm.jar (13 MB at 2.5 MB/s)
Downloading from google-maven-central: https://maven-central.storage-download.googleapis.com/maven2/org/bytedeco/ffmpeg/4.3.2-1.5.5/ffmpeg-4.3.2-1.5.5-windows-x86_64.jar
Downloaded from google-maven-central: https://maven-central.storage-download.googleapis.com/maven2/org/bytedeco/ffmpeg/4.3.2-1.5.5/ffmpeg-4.3.2-1.5.5-linux-arm64.jar (13 MB at 2.2 MB/s)
Downloading from google-maven-central: https://maven-central.storage-download.googleapis.com/maven2/org/bytedeco/leptonica-platform/1.80.0-1.5.5/leptonica-platform-1.80.0-1.5.5.jar
Downloaded from google-maven-central: https://maven-central.storage-download.googleapis.com/maven2/org/bytedeco/ffmpeg/4.3.2-1.5.5/ffmpeg-4.3.2-1.5.5-linux-ppc64le.jar (15 MB at 2.4 MB/s)
Downloading from google-maven-central: https://maven-central.storage-download.googleapis.com/maven2/org/bytedeco/leptonica/1.80.0-1.5.5/leptonica-1.80.0-1.5.5-android-arm.jar
Downloaded from google-maven-central: https://maven-central.storage-download.googleapis.com/maven2/org/bytedeco/ffmpeg/4.3.2-1.5.5/ffmpeg-4.3.2-1.5.5-windows-x86_64.jar (14 MB at 2.1 MB/s)
Downloading from google-maven-central: https://maven-central.storage-download.googleapis.com/maven2/org/bytedeco/leptonica/1.80.0-1.5.5/leptonica-1.80.0-1.5.5-android-arm64.jar
Downloaded from google-maven-central: https://maven-central.storage-download.googleapis.com/maven2/org/bytedeco/ffmpeg/4.3.2-1.5.5/ffmpeg-4.3.2-1.5.5-macosx-x86_64.jar (14 MB at 2.0 MB/s)
Downloading from google-maven-central: https://maven-central.storage-download.googleapis.com/maven2/org/bytedeco/leptonica/1.80.0-1.5.5/leptonica-1.80.0-1.5.5-android-x86.jar
Downloaded from google-maven-central: https://maven-central.storage-download.googleapis.com/maven2/org/bytedeco/leptonica-platform/1.80.0-1.5.5/leptonica-platform-1.80.0-1.5.5.jar (3.2 kB at 451 B/s)
Downloading from google-maven-central: https://maven-central.storage-download.googleapis.com/maven2/org/bytedeco/leptonica/1.80.0-1.5.5/leptonica-1.80.0-1.5.5-android-x86_64.jar
Downloaded from google-maven-central: https://maven-central.storage-download.googleapis.com/maven2/org/bytedeco/ffmpeg/4.3.2-1.5.5/ffmpeg-4.3.2-1.5.5-windows-x86.jar (14 MB at 2.0 MB/s)
Downloading from google-maven-central: https://maven-central.storage-download.googleapis.com/maven2/org/bytedeco/leptonica/1.80.0-1.5.5/leptonica-1.80.0-1.5.5-linux-x86.jar
Downloaded from google-maven-central: https://maven-central.storage-download.googleapis.com/maven2/org/bytedeco/leptonica/1.80.0-1.5.5/leptonica-1.80.0-1.5.5-android-arm.jar (2.8 MB at 374 kB/s)
Downloading from google-maven-central: https://maven-central.storage-download.googleapis.com/maven2/org/bytedeco/leptonica/1.80.0-1.5.5/leptonica-1.80.0-1.5.5-linux-x86_64.jar
Downloaded from google-maven-central: https://maven-central.storage-download.googleapis.com/maven2/org/bytedeco/leptonica/1.80.0-1.5.5/leptonica-1.80.0-1.5.5-android-x86.jar (3.3 MB at 409 kB/s)
Downloading from google-maven-central: https://maven-central.storage-download.googleapis.com/maven2/org/bytedeco/leptonica/1.80.0-1.5.5/leptonica-1.80.0-1.5.5-linux-armhf.jar
Downloaded from google-maven-central: https://maven-central.storage-download.googleapis.com/maven2/org/bytedeco/leptonica/1.80.0-1.5.5/leptonica-1.80.0-1.5.5-android-arm64.jar (2.8 MB at 346 kB/s)
Downloading from google-maven-central: https://maven-central.storage-download.googleapis.com/maven2/org/bytedeco/leptonica/1.80.0-1.5.5/leptonica-1.80.0-1.5.5-linux-arm64.jar
Downloaded from google-maven-central: https://maven-central.storage-download.googleapis.com/maven2/org/bytedeco/leptonica/1.80.0-1.5.5/leptonica-1.80.0-1.5.5-android-x86_64.jar (3.2 MB at 387 kB/s)
Downloading from google-maven-central: https://maven-central.storage-download.googleapis.com/maven2/org/bytedeco/leptonica/1.80.0-1.5.5/leptonica-1.80.0-1.5.5-linux-ppc64le.jar
Downloaded from google-maven-central: https://maven-central.storage-download.googleapis.com/maven2/org/bytedeco/leptonica/1.80.0-1.5.5/leptonica-1.80.0-1.5.5-linux-x86.jar (4.0 MB at 483 kB/s)
Downloading from google-maven-central: https://maven-central.storage-download.googleapis.com/maven2/org/bytedeco/leptonica/1.80.0-1.5.5/leptonica-1.80.0-1.5.5-macosx-x86_64.jar
Downloaded from google-maven-central: https://maven-central.storage-download.googleapis.com/maven2/org/bytedeco/leptonica/1.80.0-1.5.5/leptonica-1.80.0-1.5.5-linux-arm64.jar (4.1 MB at 438 kB/s)
Downloading from google-maven-central: https://maven-central.storage-download.googleapis.com/maven2/org/bytedeco/leptonica/1.80.0-1.5.5/leptonica-1.80.0-1.5.5-windows-x86.jar
Downloaded from google-maven-central: https://maven-central.storage-download.googleapis.com/maven2/org/bytedeco/leptonica/1.80.0-1.5.5/leptonica-1.80.0-1.5.5-linux-x86_64.jar (4.3 MB at 446 kB/s)
Downloading from google-maven-central: https://maven-central.storage-download.googleapis.com/maven2/org/bytedeco/leptonica/1.80.0-1.5.5/leptonica-1.80.0-1.5.5-windows-x86_64.jar
Downloaded from google-maven-central: https://maven-central.storage-download.googleapis.com/maven2/org/bytedeco/leptonica/1.80.0-1.5.5/leptonica-1.80.0-1.5.5-linux-armhf.jar (4.0 MB at 400 kB/s)
Downloaded from google-maven-central: https://maven-central.storage-download.googleapis.com/maven2/org/bytedeco/leptonica/1.80.0-1.5.5/leptonica-1.80.0-1.5.5-macosx-x86_64.jar (4.3 MB at 429 kB/s)
Downloaded from google-maven-central: https://maven-central.storage-download.googleapis.com/maven2/org/bytedeco/leptonica/1.80.0-1.5.5/leptonica-1.80.0-1.5.5-linux-ppc64le.jar (4.3 MB at 410 kB/s)
Downloaded from google-maven-central: https://maven-central.storage-download.googleapis.com/maven2/org/bytedeco/leptonica/1.80.0-1.5.5/leptonica-1.80.0-1.5.5-windows-x86.jar (4.9 MB at 449 kB/s)
Downloaded from google-maven-central: https://maven-central.storage-download.googleapis.com/maven2/org/bytedeco/leptonica/1.80.0-1.5.5/leptonica-1.80.0-1.5.5-windows-x86_64.jar (4.8 MB at 440 kB/s)
[INFO]
[INFO] — exec-maven-plugin:1.4.0:java (default-cli) @ dl4j-examples —
o.d.e.q.m.c.LeNetMNIST - Load data…
o.d.e.q.m.c.LeNetMNIST - Build model…
o.n.l.f.Nd4jBackend - Loaded [CpuBackend] backend
[WARNING]
java.lang.reflect.InvocationTargetException
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:566)
at org.codehaus.mojo.exec.ExecJavaMojo$1.run (ExecJavaMojo.java:293)
at java.lang.Thread.run (Thread.java:834)
Caused by: java.lang.ExceptionInInitializerError
at org.deeplearning4j.nn.conf.NeuralNetConfiguration$Builder.seed (NeuralNetConfiguration.java:655)
at org.deeplearning4j.examples.quickstart.modeling.convolution.LeNetMNIST.main (LeNetMNIST.java:74)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:566)
at org.codehaus.mojo.exec.ExecJavaMojo$1.run (ExecJavaMojo.java:293)
at java.lang.Thread.run (Thread.java:834)
Caused by: java.lang.RuntimeException: java.lang.NullPointerException
at org.nd4j.linalg.factory.Nd4j.initWithBackend (Nd4j.java:5329)
at org.nd4j.linalg.factory.Nd4j.initContext (Nd4j.java:5186)
at org.nd4j.linalg.factory.Nd4j. (Nd4j.java:314)
at org.deeplearning4j.nn.conf.NeuralNetConfiguration$Builder.seed (NeuralNetConfiguration.java:655)
at org.deeplearning4j.examples.quickstart.modeling.convolution.LeNetMNIST.main (LeNetMNIST.java:74)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:566)
at org.codehaus.mojo.exec.ExecJavaMojo$1.run (ExecJavaMojo.java:293)
at java.lang.Thread.run (Thread.java:834)
Caused by: java.lang.NullPointerException
at org.nd4j.linalg.factory.Nd4j.initWithBackend (Nd4j.java:5257)
at org.nd4j.linalg.factory.Nd4j.initContext (Nd4j.java:5186)
at org.nd4j.linalg.factory.Nd4j. (Nd4j.java:314)
at org.deeplearning4j.nn.conf.NeuralNetConfiguration$Builder.seed (NeuralNetConfiguration.java:655)
at org.deeplearning4j.examples.quickstart.modeling.convolution.LeNetMNIST.main (LeNetMNIST.java:74)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:566)
at org.codehaus.mojo.exec.ExecJavaMojo$1.run (ExecJavaMojo.java:293)
at java.lang.Thread.run (Thread.java:834)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 13.171 s
[INFO] Finished at: 2023-04-11T15:08:15+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.4.0:java (default-cli) on project dl4j-examples: An exception occured while executing the Java class. null: InvocationTargetException: ExceptionInInitializerError: java.lang.NullPointerException → [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

@yaoyao when did you clone this code? According to your stack trace, you have a missing file property
here:

I clearly see that id in master here:

I will clone a newest examples repo, and tri it again.

@yaoyao no not the examples. Please quit doing anything with the examples.
If you pay attention, you’ll see I linked the source code. Not the examples.

The source code and examples are completely different repositories. If you clone the examples again you’ll just have to retrace the same steps of changing M2.1 to snapshots and you won’t accomplish anything.

I use the newest DL4J project, but the error still exists…

any other methods for fixing this ?

@yaoyao yes by not ignoring me. I already told you what to do. I showed you literally the exact lines you should be seeing in your local version of the code.

I feel like maybe because of language barrier or something you only ready half of what I say and then just try something on your own.

It hurts that I have to guess that but you’ve been not been at all communicative in your github issues or your forum posts. I don’t even know when I solve your issue.

I’m sorry but it’s really difficult to help you if you won’t do something like ask a clarifying question.

If you can instead of ignoring me ask what I mean if that is your issue, then please do that. I would rather know what you don’t understand and then answer you then guess what your situation is.

The line number is as same as you given:

and

@yaoyao appreciated. Please do that from now on. I’m only trying to help you. Remember I don’t have access to your machine so I don’t know what you do/don’t have.
Sorry this is frustrating for me too. Builds should not be this complicated.

We know you have the correct source code then. Could you check the .m2/repository/org/nd4j/nd4j-api/1.0.0-SNAPSHOT/ jar file to see if you find that value with the properties in there? You can also put a debugger on that line and show that to me as well.

If the correct file is there there is no reason it shouldn’t be showing up.

Could you confirm with me how you are running the program?
Edit:
@yaoyao if you are using intellij could you also run file → invalidate caches and restart?

  1. I see the content of the generated SNAPSHOT jar file, it includes org dir and a nd4j-native.properties file. I discover that it losts the last 3 lines.

Maybe I need to build the DL4J project again?

  1. I run the example by command mvn exec:java -Dexec.mainClass=“org.deeplearning4j.examples.quickstart.modeling.convolution.LeNetMNIST”

@yaoyao ok so your local jar is still off somehow. Thank you for confirming. That’s why I asked you to rebuild everything as well as delete your .m2.

Rebuild the deeplearning4j project (not the examples) and make sure the modules are correct in the following places:

  1. nd4j-api/target directory (this is where the jar file is generated and copied from to the .m2)
  2. the .m2 folder (this is where the examples as a separate project will look for the nd4j-api module)

Hi! Followed by your instructions, I cleaned all the m2 repo and execute the mvn clean install -DskipTests in the root dir of deeplearning4j. And a 1.0.0-SNAPSHOT dir with a snapshot jar package is generated.

The null pointer error still reported.

BTW, the nd4j-native.properties file in snapshot is as same as the file in M2.1. What can I do then?

@yaoyao I still think your problem is very localized to you somehow. I work with customers who work with snapshots all day + my own constant updating of the code and never run in to this.

Could you just run this through the debugger and see what file it tries to load? There’s zero reason this should be happening.

I’ve already showed you why it happens, where the file is. We need to break this down.

After mvn clean install -DskipTests command, the nd4j-api/target folder looks like this:

and my m2 repo is in the correct location.

Fine, I will debug it.

@yaoyao sorry when I mean “debug” I think you misunderstood maybe? I mean run your code under the debugger where it tries to load the file and show me that. I don’t mean “just debug this yourself” I really just need more information.

Thanks for your help, I use git to clone the source code (branch) in version 1.0.0-M2.1, and I can successfully compiled & use the corresponding snapshot it in my project.

But the source code in the master branch still occrus errors somehow. Anyway, thanks!

Regards,

DL4J lover.

@yaoyao that’s great! Thanks for confirming. Can you tell me a bit about your platform so I can potentially fix the issue? I still feel like I’m missing something.

Of course. This is my server config:

Linux dell-PowerEdge-R740 5.11.0-27-generic #29~20.04.1-Ubuntu SMP Wed Aug 11 15:58:17 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

BYW, my server only have Intel CPUs, no GPU devices or CUDA environment.

cmake 3.20.2
GNU Make 4.2.1
Apache Maven 3.8.8
openjdk 11.0.18 2023-01-17

@yaoyao thanks. I’m sorry about the weirdness there. I’ve been building on prod centos 7 for customers for a while now. That’s usually the main problem config.
I’ll keep an eye on this for the release to see if something else si going on there.

Usually you’d run in to unknown libc issues or potentially linker issues. I am in the middle of a few PRs that fix some unknown symbols: Fix undefined symbols, Migrate more ints -> sd::LongType by agibsonccc · Pull Request #9963 · deeplearning4j/deeplearning4j · GitHub
I have probably 1 more batch of changes like this as follow up but beyond that have not encountered anything specific.