Импорт и работа с библиотекой dl4j в VSCode через gradle.build
Всем доброго времени суток. Хочу поинтересоваться у экспертов в вопросе, как именно импортировать библиотеку dl4j в свой проект на java в VSCode, используя gradle. Я успешно сделал это в Андроид Студии, но там она не хочет запускаться на эмуляторе, не знаю по каким причинам. Для удобства работы в консоли и отслеживания результатов обучения хотел запустить ее в VSCode, но gradle просто отказывается собирать проект. Я уже не знаю что мне делать. Для доп информации пришлю свой файл gradle.build и еще скрин проекта и сам код самой программы. Так же вышлю файл с ошибками и проблемами. Если у кого есть возможность и время подскажите что делать..
gradle.build
```
plugins {
// Apply the application plugin to add support for building a CLI application in Java.
id 'application'
}
repositories {
// Use Maven Central for resolving dependencies.
mavenCentral()
}
configurations {
javacpp
}
task javacppExtract(type: Copy) {
dependsOn configurations.javacpp
from { configurations.javacpp.collect { zipTree(it) } }
include "lib/**"
into "$buildDir/javacpp/"
}
dependencies {
def dl4jVersion = '1.0.0-M2'
def openblasVersion = '0.3.19-1.5.7'
def opencvVersion = '4.5.5-1.5.7'
def leptonicaVersion = '1.82.0-1.5.7'
implementation fileTree(dir: 'libs', include: ['*.jar'])
// Use JUnit Jupiter for testing.
testImplementation 'org.junit.jupiter:junit-jupiter:5.9.1'
// This dependency is used by the application.
implementation 'com.google.guava:guava:31.1-jre'
implementation(group: 'org.deeplearning4j', name: 'deeplearning4j-core', version: '1.0.0-M2.1') {
exclude group: 'org.bytedeco', module: 'opencv-platform'
exclude group: 'org.bytedeco', module: 'leptonica-platform'
exclude group: 'org.bytedeco', module: 'hdf5-platform'
exclude group: 'org.nd4j', module: 'nd4j-base64'
exclude group: 'org.nd4j', module: 'nd4j-api'
}
implementation group: 'org.nd4j', name: 'nd4j-native', version: '1.0.0-M2.1'
implementation group: 'org.nd4j', name: 'nd4j-native', version: '1.0.0-M2.1', classifier: "android-arm"
implementation group: 'org.nd4j', name: 'nd4j-native', version: '1.0.0-M2.1', classifier: "android-arm64"
implementation group: 'org.nd4j', name: 'nd4j-native', version: '1.0.0-M2.1', classifier: "android-x86"
implementation group: 'org.nd4j', name: 'nd4j-native', version: '1.0.0-M2.1', classifier: "android-x86_64"
implementation group: 'org.bytedeco', name: 'openblas', version: openblasVersion
implementation group: 'org.bytedeco', name: 'openblas', version: openblasVersion, classifier: "android-arm"
implementation group: 'org.bytedeco', name: 'openblas', version: openblasVersion, classifier: "android-arm64"
implementation group: 'org.bytedeco', name: 'openblas', version: openblasVersion, classifier: "android-x86"
implementation group: 'org.bytedeco', name: 'openblas', version: openblasVersion, classifier: "android-x86_64"
implementation group: 'org.bytedeco', name: 'opencv', version: opencvVersion
implementation group: 'org.bytedeco', name: 'opencv', version: opencvVersion, classifier: "android-arm"
implementation group: 'org.bytedeco', name: 'opencv', version: opencvVersion, classifier: "android-arm64"
implementation group: 'org.bytedeco', name: 'opencv', version: opencvVersion, classifier: "android-x86"
implementation group: 'org.bytedeco', name: 'opencv', version: opencvVersion, classifier: "android-x86_64"
implementation group: 'org.bytedeco', name: 'leptonica', version: leptonicaVersion
implementation group: 'org.bytedeco', name: 'leptonica', version: leptonicaVersion, classifier: "android-arm"
implementation group: 'org.bytedeco', name: 'leptonica', version: leptonicaVersion, classifier: "android-arm64"
implementation group: 'org.bytedeco', name: 'leptonica', version: leptonicaVersion, classifier: "android-x86"
implementation group: 'org.bytedeco', name: 'leptonica', version: leptonicaVersion, classifier: "android-x86_64"
}
application {
// Define the main class for the application.
mainClass = 'myai3.App'
}
tasks.named('test') {
// Use JUnit Platform for unit tests.
useJUnitPlatform()
}
```
```
package myai3;
import static org.nd4j.linalg.activations.Activation.SIGMOID;
import static org.nd4j.linalg.activations.Activation.SOFTMAX;
import static org.nd4j.linalg.lossfunctions.LossFunctions.LossFunction.NEGATIVELOGLIKELIHOOD;
import java.io.File;
import java.io.IOException;
import org.datavec.image.loader.NativeImageLoader;
import org.deeplearning4j.nn.api.OptimizationAlgorithm;
import org.deeplearning4j.nn.conf.MultiLayerConfiguration;
import org.deeplearning4j.nn.conf.NeuralNetConfiguration;
import org.deeplearning4j.nn.conf.layers.ConvolutionLayer;
import org.deeplearning4j.nn.conf.layers.DenseLayer;
import org.deeplearning4j.nn.conf.layers.OutputLayer;
import org.deeplearning4j.nn.multilayer.MultiLayerNetwork;
import org.deeplearning4j.nn.weights.WeightInit;
import org.deeplearning4j.util.ModelSerializer;
import org.nd4j.evaluation.classification.Evaluation;
import org.nd4j.linalg.activations.Activation;
import org.nd4j.linalg.api.ndarray.INDArray;
import org.nd4j.linalg.dataset.DataSet;
import org.nd4j.linalg.dataset.SplitTestAndTrain;
import org.nd4j.linalg.dataset.api.preprocessor.DataNormalization;
import org.nd4j.linalg.dataset.api.preprocessor.ImagePreProcessingScaler;
import org.nd4j.linalg.factory.Nd4j;
import org.nd4j.linalg.learning.config.Adam;
public class App {
public static int height = 1080; // высота изображения
public static int width = 1920; // ширина изображения
public static int channels = 3; // каналы изображения (3 для RGB, 1 для Grayscale)
public static int outputNum = 2;
public static INDArray labelsList = null;
public static INDArray featureList = null;
static MultiLayerConfiguration conf = new NeuralNetConfiguration.Builder()
.seed(123)
.optimizationAlgo(OptimizationAlgorithm.STOCHASTIC_GRADIENT_DESCENT)
.updater(new Adam())
.list()
.layer(0, new ConvolutionLayer.Builder(5, 5)
.nIn(channels)
.stride(1, 1)
.nOut(width)
.activation(Activation.SIGMOID)
.weightInit(WeightInit.XAVIER)
.build())
.layer(1, new DenseLayer.Builder().activation(SIGMOID).nOut(height).build())
.layer(2, new OutputLayer.Builder(NEGATIVELOGLIKELIHOOD)
.nOut(outputNum)
.activation(SOFTMAX)
.build())
.build();
/**
* @param args
*/
public static void main(String[] args) {
MultiLayerNetwork model = new MultiLayerNetwork(conf);
model.init();
//2. Загрузка DataFiles
File folder = new File( "C:\\Users\\user\\Desktop\\dataset");
File[] listOfFiles = folder.listFiles();
for (File file : listOfFiles) {
if (file.isFile()) {
// Загрузка изображения
NativeImageLoader loader = new NativeImageLoader(height, width, channels);
INDArray image = null;
try {
image = loader.asMatrix(file);
} catch (IOException e) {
throw new RuntimeException(e);
}
// Нормализация изображения
DataNormalization scaler = new ImagePreProcessingScaler(0, 1);
scaler.transform(image);
// Добавление изображения в список признаков
featureList.add(image);
// Парсинг имени файла для получения меток
String fileName = file.getName();
fileName = fileName.replace("files:", ""); // Удаление "files:"
String[] splitName = fileName.split("_");
double x = Double.parseDouble(splitName[0]);
double y = Double.parseDouble(splitName[1].split("\\.")[0]);
// Добавление меток в список меток
labelsList.add(Nd4j.create(new double[]{x, y}));
}
}
//3. Обучение ИИ
// Разделение данных на обучающую и тестовую выборки
int batchSize = 128; // Размер пакета для обучения
int numEpochs = 10; // Количество эпох для обучения
DataSet allData = new DataSet(featureList, labelsList);
allData.shuffle();
SplitTestAndTrain testAndTrain = allData.splitTestAndTrain(0.8); // 80% данных для
обучения, 20% для тестирования
DataSet trainingData = testAndTrain.getTrain();
DataSet testData = testAndTrain.getTest();
// Обучение модели
for( int i=0; i<numEpochs; i++ ){
model.fit(trainingData);
}
// Оценка модели
Evaluation eval = new Evaluation(outputNum); // Создание объекта для оценки модели
INDArray output = model.output(testData.getFeatures()); // Получение выходных
данных модели для тестовой выборки
eval.eval(testData.getLabels(), output); // Оценка модели
// Вывод результатов оценки
System.out.println(eval.stats());
//4. Сохранение обученной модели
String modelFilename = "model.zip";
// Сохранение модели
File locationToSave = new File(modelFilename);
boolean saveUpdater = true; // Сохранение информации для дальнейшего обучения
try {
ModelSerializer.writeModel(model, locationToSave, saveUpdater);
} catch (IOException e) {
throw new RuntimeException(e);
}
// 5. Загрузка обученной модели
try {
model = ModelSerializer.restoreMultiLayerNetwork(modelFilename, saveUpdater);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
public Object getGreeting() {
// TODO Auto-generated method stub
throw new UnsupportedOperationException("Unimplemented method 'getGreeting'");
}
}
// 5. Загрузка обученной модели
try {
model = ModelSerializer.restoreMultiLayerNetwork(modelFilename, saveUpdater);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
public Object getGreeting() {
// TODO Auto-generated method stub
throw new UnsupportedOperationException("Unimplemented method 'getGreeting'");
}
}
```
Лог из сообщений gradle, в том числе ошибки...
PS C:\Users\user\Desktop\NeuralNetwork\MyAI3> ./gradlew build --info
Initialized native services in: C:\Users\user\.gradle\native
Initialized jansi services in: C:\Users\user\.gradle\native
Received JVM installation metadata from 'C:\Users\user\AppData\Local\Programs\Eclipse Adoptium\jdk-17.0.9.9-hotspot': {JAVA_HOME=C:\Users\user\AppData\Local\Programs\Eclipse Adoptium\jdk-17.0.9.9-hotspot, JAVA_VERSION=17.0.9, JAVA_VENDOR=Eclipse Adoptium, RUNTIME_NAME=OpenJDK Runtime Environment, RUNTIME_VERSION=17.0.9+9, VM_NAME=OpenJDK 64-Bit Server VM, VM_VERSION=17.0.9+9, VM_VENDOR=Eclipse Adoptium, OS_ARCH=amd64}
Found daemon DaemonInfo{pid=18776, address=[b7de0f70-8bd2-434b-b5a2-53babc6d6456 port:60548, addresses:[/127.0.0.1]], state=Idle, lastBusy=1711104278649, context=DefaultDaemonContext[uid=e1b9214f-b50e-44aa-9211-e55e54d54e6c,javaHome=C:\Users\user\AppData\Local\Programs\Eclipse Adoptium\jdk-17.0.9.9-hotspot,daemonRegistryDir=C:\Users\user\.gradle\daemon,pid=18776,idleTimeout=10800000,priority=NORMAL,daemonOpts=--add-opens=java.base/java.util=ALL-UNNAMED,--add-opens=java.base/java.lang=ALL-UNNAMED,--add-opens=java.base/java.lang.invoke=ALL-UNNAMED,--add-opens=java.prefs/java.util.prefs=ALL-UNNAMED,--add-opens=java.base/java.nio.charset=ALL-UNNAMED,--add-opens=java.base/java.net=ALL-UNNAMED,--add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED,-XX:MaxMetaspaceSize=384m,-XX:+HeapDumpOnOutOfMemoryError,-Xms256m,-Xmx512m,-Dfile.encoding=UTF-8,-Duser.country=RU,-Duser.language=ru,-Duser.variant]} however its context does not match the desired criteria.
At least one daemon option is different.
Wanted: DefaultDaemonContext[uid=null,javaHome=C:\Users\user\AppData\Local\Programs\Eclipse Adoptium\jdk-17.0.9.9-hotspot,daemonRegistryDir=C:\Users\user\.gradle\daemon,pid=14312,idleTimeout=null,priority=NORMAL,daemonOpts=--add-opens=java.base/java.util=ALL-UNNAMED,--add-opens=java.base/java.lang=ALL-UNNAMED,--add-opens=java.base/java.lang.invoke=ALL-UNNAMED,--add-opens=java.prefs/java.util.prefs=ALL-UNNAMED,--add-opens=java.base/java.nio.charset=ALL-UNNAMED,--add-opens=java.base/java.net=ALL-UNNAMED,--add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED,-XX:MaxMetaspaceSize=384m,-XX:+HeapDumpOnOutOfMemoryError,-Xms256m,-Xmx512m,-Dfile.encoding=windows-1251,-Duser.country=RU,-Duser.language=ru,-Duser.variant]
Actual: DefaultDaemonContext[uid=e1b9214f-b50e-44aa-9211-e55e54d54e6c,javaHome=C:\Users\user\AppData\Local\Programs\Eclipse Adoptium\jdk-17.0.9.9-hotspot,daemonRegistryDir=C:\Users\user\.gradle\daemon,pid=18776,idleTimeout=10800000,priority=NORMAL,daemonOpts=--add-opens=java.base/java.util=ALL-UNNAMED,--add-opens=java.base/java.lang=ALL-UNNAMED,--add-opens=java.base/java.lang.invoke=ALL-UNNAMED,--add-opens=java.prefs/java.util.prefs=ALL-UNNAMED,--add-opens=java.base/java.nio.charset=ALL-UNNAMED,--add-opens=java.base/java.net=ALL-UNNAMED,--add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED,-XX:MaxMetaspaceSize=384m,-XX:+HeapDumpOnOutOfMemoryError,-Xms256m,-Xmx512m,-Dfile.encoding=UTF-8,-Duser.country=RU,-Duser.language=ru,-Duser.variant]
Looking for a different daemon...
The client will now receive all logging from the daemon (pid: 17936). The daemon log file: C:\Users\user\.gradle\daemon\8.0.2\daemon-17936.out.log
Starting 12th build in daemon [uptime: 1 hrs 3 mins 11.466 secs, performance: 100%, GC rate: 0.00/s, heap usage: 0% of 512 MiB, non-heap usage: 18% of 384 MiB]
Using 12 worker leases.
Now considering [C:\Users\user\Desktop\NeuralNetwork\MyAI3] as hierarchies to watch
Watching the file system is configured to be enabled if available
File system watching is active
Starting Build
Settings evaluated using settings file 'C:\Users\user\Desktop\NeuralNetwork\MyAI3\settings.gradle'.
Projects loaded. Root project using build file 'C:\Users\user\Desktop\NeuralNetwork\MyAI3\build.gradle'.
Included projects: [root project 'MyAI3', project ':app']
> Configure project :
Evaluating root project 'MyAI3' using build file 'C:\Users\user\Desktop\NeuralNetwork\MyAI3\build.gradle'.
Invalidating in-memory cache of C:\Users\user\.gradle\caches\journal-1\file-access.bin
> Configure project :app
Evaluating project ':app' using build file 'C:\Users\user\Desktop\NeuralNetwork\MyAI3\app\build.gradle'.
Invalidating in-memory cache of C:\Users\user\.gradle\caches\8.0.2\fileHashes\fileHashes.bin
Invalidating in-memory cache of C:\Users\user\.gradle\caches\8.0.2\fileHashes\resourceHashesCache.bin
All projects evaluated.
Task name matched 'build'
Selected primary task 'build' from project :
The configuration :app:javacpp is both resolvable and consumable. This is considered a legacy configuration and it will eventually only be possible to be one of these.
The configuration :app:javacpp is both consumable and declarable. This combination is incorrect, only one of these flags should be set.
The configuration :app:mainSourceElements is both consumable and declarable. This combination is incorrect, only one of these flags should be set.
The configuration :app:testResultsElementsForTest is both consumable and declarable. This combination is incorrect, only one of these flags should be set.
Tasks to be executed: [task ':app:compileJava', task ':app:processResources', task ':app:classes', task ':app:jar', task ':app:startScripts', task ':app:distTar', task ':app:distZip', task ':app:assemble', task ':app:compileTestJava', task ':app:processTestResources', task ':app:testClasses', task ':app:test', task ':app:check', task ':app:build']
Tasks that were excluded: []
Resolve mutations for :app:compileJava (Thread[Execution worker,5,main]) started.
:app:compileJava (Thread[Execution worker,5,main]) started.
> Task :app:compileJava UP-TO-DATE
file or directory 'C:\Users\user\Desktop\NeuralNetwork\MyAI3\app\libs', not found
file or directory 'C:\Users\user\Desktop\NeuralNetwork\MyAI3\app\libs', not found
Caching disabled for task ':app:compileJava' because:
Build cache is disabled
Skipping task ':app:compileJava' as it is up-to-date.
Resolve mutations for :app:processResources (Thread[included builds,5,main]) started.
:app:processResources (Thread[included builds,5,main]) started.
> Task :app:processResources NO-SOURCE
Skipping task ':app:processResources' as it has no source files and no previous output files.
Resolve mutations for :app:classes (Thread[included builds,5,main]) started.
:app:classes (Thread[included builds,5,main]) started.
> Task :app:classes UP-TO-DATE
Skipping task ':app:classes' as it has no actions.
Resolve mutations for :app:jar (Thread[included builds,5,main]) started.
:app:jar (Thread[included builds,5,main]) started.
> Task :app:jar UP-TO-DATE
Caching disabled for task ':app:jar' because:
Build cache is disabled
Skipping task ':app:jar' as it is up-to-date.
Resolve mutations for :app:startScripts (Thread[included builds,5,main]) started.
:app:startScripts (Thread[Execution worker Thread 7,5,main]) started.
> Task :app:startScripts UP-TO-DATE
file or directory 'C:\Users\user\Desktop\NeuralNetwork\MyAI3\app\libs', not found
file or directory 'C:\Users\user\Desktop\NeuralNetwork\MyAI3\app\libs', not found
file or directory 'C:\Users\user\Desktop\NeuralNetwork\MyAI3\app\libs', not found
Caching disabled for task ':app:startScripts' because:
Build cache is disabled
Skipping task ':app:startScripts' as it is up-to-date.
Resolve mutations for :app:distTar (Thread[Execution worker Thread 7,5,main]) started.
:app:distTar (Thread[Execution worker Thread 7,5,main]) started.
> Task :app:distTar UP-TO-DATE
file or directory 'C:\Users\user\Desktop\NeuralNetwork\MyAI3\app\libs', not found
file or directory 'C:\Users\user\Desktop\NeuralNetwork\MyAI3\app\libs', not found
Caching disabled for task ':app:distTar' because:
Build cache is disabled
Skipping task ':app:distTar' as it is up-to-date.
Resolve mutations for :app:distZip (Thread[Execution worker Thread 7,5,main]) started.
:app:distZip (Thread[included builds,5,main]) started.
> Task :app:distZip UP-TO-DATE
file or directory 'C:\Users\user\Desktop\NeuralNetwork\MyAI3\app\libs', not found
file or directory 'C:\Users\user\Desktop\NeuralNetwork\MyAI3\app\libs', not found
Caching disabled for task ':app:distZip' because:
Build cache is disabled
Skipping task ':app:distZip' as it is up-to-date.
Resolve mutations for :app:assemble (Thread[included builds,5,main]) started.
:app:assemble (Thread[Execution worker Thread 6,5,main]) started.
> Task :app:assemble UP-TO-DATE
Skipping task ':app:assemble' as it has no actions.
Resolve mutations for :app:compileTestJava (Thread[Execution worker Thread 6,5,main]) started.
:app:compileTestJava (Thread[Execution worker Thread 6,5,main]) started.
> Task :app:compileTestJava UP-TO-DATE
file or directory 'C:\Users\user\Desktop\NeuralNetwork\MyAI3\app\libs', not found
file or directory 'C:\Users\user\Desktop\NeuralNetwork\MyAI3\app\libs', not found
Caching disabled for task ':app:compileTestJava' because:
Build cache is disabled
Skipping task ':app:compileTestJava' as it is up-to-date.
Resolve mutations for :app:processTestResources (Thread[Execution worker Thread 6,5,main]) started.
:app:processTestResources (Thread[Execution worker Thread 6,5,main]) started.
> Task :app:processTestResources NO-SOURCE
Skipping task ':app:processTestResources' as it has no source files and no previous output files.
Resolve mutations for :app:testClasses (Thread[Execution worker Thread 6,5,main]) started.
:app:testClasses (Thread[included builds,5,main]) started.
> Task :app:testClasses UP-TO-DATE
Skipping task ':app:testClasses' as it has no actions.
Resolve mutations for :app:test (Thread[included builds,5,main]) started.
:app:test (Thread[included builds,5,main]) started.
Gradle Test Executor 6 started executing tests.
Gradle Test Executor 6 finished executing tests.
> Task :app:test FAILED
file or directory 'C:\Users\user\Desktop\NeuralNetwork\MyAI3\app\libs', not found
file or directory 'C:\Users\user\Desktop\NeuralNetwork\MyAI3\app\libs', not found
Caching disabled for task ':app:test' because:
Build cache is disabled
Task ':app:test' is not up-to-date because:
Task has failed previously.
file or directory 'C:\Users\user\Desktop\NeuralNetwork\MyAI3\app\libs', not found
Starting process 'Gradle Test Executor 6'. Working directory: C:\Users\user\Desktop\NeuralNetwork\MyAI3\app Command: C:\Users\user\AppData\Local\Programs\Eclipse Adoptium\jdk-17.0.9.9-hotspot\bin\java.exe -Dorg.gradle.internal.worker.tmpdir=C:\Users\user\Desktop\NeuralNetwork\MyAI3\app\build\tmp\test\work -Dorg.gradle.native=false @C:\Users\user\.gradle\.tmp\gradle-worker-classpath9249429640499906904txt -Xmx512m -Dfile.encoding=windows-1251 -Duser.country=RU -Duser.language=ru -Duser.variant -ea worker.org.gradle.process.internal.worker.GradleWorkerMain 'Gradle Test Executor 6'
Successfully started process 'Gradle Test Executor 6'
AppTest > appHasAGreeting() STANDARD_ERROR
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
AppTest > appHasAGreeting() FAILED
java.lang.ExceptionInInitializerError
at org.nd4j.linalg.cpu.nativecpu.ops.NativeOpExecutioner.<init>(NativeOpExecutioner.java:79)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
at java.base/java.lang.reflect.ReflectAccess.newInstance(ReflectAccess.java:128)
at java.base/jdk.internal.reflect.ReflectionFactory.newInstance(ReflectionFactory.java:347)
at java.base/java.lang.Class.newInstance(Class.java:645)
at org.nd4j.linalg.factory.Nd4j.initWithBackend(Nd4j.java:5152)
at org.nd4j.linalg.factory.Nd4j.initContext(Nd4j.java:5064)
at org.nd4j.linalg.factory.Nd4j.<clinit>(Nd4j.java:284)
at org.deeplearning4j.nn.conf.NeuralNetConfiguration$Builder.seed(NeuralNetConfiguration.java:655)
at myai3.App.<clinit>(App.java:44)
at myai3.AppTest.appHasAGreeting(AppTest.java:11)
Caused by:
java.lang.RuntimeException: ND4J is probably missing dependencies. For more information, please refer to: https://deeplearning4j.konduit.ai/nd4j/backend
at org.nd4j.nativeblas.NativeOpsHolder.<init>(NativeOpsHolder.java:107)
at org.nd4j.nativeblas.NativeOpsHolder.<clinit>(NativeOpsHolder.java:41)
... 14 more
Caused by:
java.lang.UnsatisfiedLinkError: no jniopenblas_nolapack in java.library.path: C:\Users\user\AppData\Local\Programs\Eclipse Adoptium\jdk-17.0.9.9-hotspot\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\apache-maven-3.9.6\bin;C:\Users\user\AppData\Local\Programs\Eclipse Adoptium\jdk-17.0.9.9-hotspot\;C:\Program Files\dotnet\;C:\Program Files\Git\cmd;C:\Users\user\AppData\Local\Programs\Eclipse Adoptium\jdk-17.0.9.9-hotspot\bin;C:\Users\user\AppData\Local\Microsoft\WindowsApps;C:\Program Files\JetBrains\IntelliJ IDEA 2023.1.1\bin;;C:\Users\user\AppData\Local\Programs\Microsoft VS Code\bin;C:\Program Files\apache-maven-3.9.6\bin;;C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2023.3.3\bin;;C:\Users\user\.dotnet\tools;.
at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2434)
at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:818)
at java.base/java.lang.System.loadLibrary(System.java:1989)
at org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:1800)
at org.bytedeco.javacpp.Loader.load(Loader.java:1402)
at org.bytedeco.javacpp.Loader.load(Loader.java:1214)
at org.bytedeco.javacpp.Loader.load(Loader.java:1190)
at org.bytedeco.openblas.global.openblas_nolapack.<clinit>(openblas_nolapack.java:12)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:467)
at org.bytedeco.javacpp.Loader.load(Loader.java:1269)
at org.bytedeco.javacpp.Loader.load(Loader.java:1214)
at org.bytedeco.javacpp.Loader.load(Loader.java:1190)
at org.nd4j.linalg.cpu.nativecpu.bindings.Nd4jCpu.<clinit>(Nd4jCpu.java:14)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:467)
at org.nd4j.common.config.ND4JClassLoading.loadClassByName(ND4JClassLoading.java:62)
at org.nd4j.common.config.ND4JClassLoading.loadClassByName(ND4JClassLoading.java:56)
at org.nd4j.nativeblas.NativeOpsHolder.<init>(NativeOpsHolder.java:97)
... 15 more
Caused by:
java.lang.UnsatisfiedLinkError: Could not find jniopenblas_nolapack in class, module, and library paths.
at org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:1767)
... 30 more
1 test completed, 1 failed
Finished generating test XML results (0.007 secs) into: C:\Users\user\Desktop\NeuralNetwork\MyAI3\app\build\test-results\test
Generating HTML test report...
Finished generating test html results (0.003 secs) into: C:\Users\user\Desktop\NeuralNetwork\MyAI3\app\build\reports\tests\test
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:test'.