直接从git获取dl4j-examples后本地无法用IJ直接运行样例,于是自己新建了一个springboot项目,主要使用了下面的一些依赖用来运行官方样例
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>3.1.5</version> <relativePath/> <!-- lookup parent from repository --> </parent> <groupId>com.example</groupId> <artifactId>Dl4jTest</artifactId> <version>0.0.1-SNAPSHOT</version> <name>Dl4jTest</name> <description>Dl4jTest</description> <properties> <java.version>17</java.version> <dl4j.version>1.0.0-M2.1</dl4j.version> <logback.version>1.1.7</logback.version> <javacv.version>1.5.6</javacv.version> <jcommon.version>1.0.23</jcommon.version> <jfreechart.version>1.0.13</jfreechart.version> <nd4j.backend>nd4j-native</nd4j.backend> </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> <!--DL4J核心包--> <dependency> <groupId>org.deeplearning4j</groupId> <artifactId>deeplearning4j-core</artifactId> <version>${dl4j.version}</version> </dependency> <!--DL4J CPU计算包--> <dependency> <groupId>org.nd4j</groupId> <artifactId>nd4j-native-platform</artifactId> <version>${dl4j.version}</version> </dependency> <!--DL4J 模型库包--> <dependency> <groupId>org.deeplearning4j</groupId> <artifactId>deeplearning4j-zoo</artifactId> <version>${dl4j.version}</version> </dependency> <dependency> <groupId>org.deeplearning4j</groupId> <artifactId>deeplearning4j-ui</artifactId> <version>${dl4j.version}</version> </dependency> <dependency> <groupId>org.deeplearning4j</groupId> <artifactId>resources</artifactId> <version>${dl4j.version}</version> </dependency> <dependency> <groupId>org.datavec</groupId> <artifactId>datavec-api</artifactId> <version>${dl4j.version}</version> </dependency> <dependency> <groupId>org.datavec</groupId> <artifactId>datavec-data-image</artifactId> <version>${dl4j.version}</version> </dependency> <dependency> <groupId>org.datavec</groupId> <artifactId>datavec-local</artifactId> <version>${dl4j.version}</version> </dependency> <dependency> <groupId>org.deeplearning4j</groupId> <artifactId>deeplearning4j-datasets</artifactId> <version>${dl4j.version}</version> </dependency> <dependency> <groupId>org.nd4j</groupId> <artifactId>${nd4j.backend}</artifactId> <version>${dl4j.version}</version> </dependency> <dependency> <groupId>org.nd4j</groupId> <artifactId>samediff-import-onnx</artifactId> <version>${dl4j.version}</version> </dependency> <!-- Note this pulls in the samediff-import-onnx module as a transitive dependency as well. This module is mainly pulled in for managing modules and is not needed for import all the time. Omnihub is suggested if you want to use our model zoo or the utilities used to manage pretrained models. --> <dependency> <groupId>org.deeplearning4j</groupId> <artifactId>omnihub</artifactId> <version>${dl4j.version}</version> </dependency> <!-- -Used for manipulating images. Contains wrapper for javacv to nd4j arrays --> <dependency> <groupId>org.datavec</groupId> <artifactId>datavec-data-image</artifactId> <version>${dl4j.version}</version> </dependency> <dependency> <groupId>org.nd4j</groupId> <artifactId>python4j-numpy</artifactId> <version>${dl4j.version}</version> </dependency> <!-- ParallelWrapper & ParallelInference live here --> <dependency> <groupId>org.deeplearning4j</groupId> <artifactId>deeplearning4j-parallel-wrapper</artifactId> <version>${dl4j.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> </dependencies> <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> </plugins> </build> </project>