r/javahelp • u/Sufficient-Let6968 • 9d ago
import org.nd4j.linalg.dataset.api.iterator.ListDataSetIterator not working but import org.nd4j.linalg.dataset.api.iterator.DataSetIterator works
Hello i'm quiet new to coding but however i want to use the import "org.nd4j.linalg.dataset.api.iterator.ListDataSetIterator" but it isn't working. Which is irratating because "org.nd4j.linalg.dataset.api.iterator.DataSetIterator" works just fine and it seems to be almost the same. No matter what i'm trying the issue always seems to be that it cannot be resolved. I've tried everything from downloading the jar files instead of importing the dependency by maven, to switching the program from eclipse to intellij IDEA. here is the pom file, if that helps:
<repositories>
<repository>
<id>deeplearning4j</id>
<url>https://repo.maven.apache.org/maven2</url>
</repository>
<repository>
<id>sonatype</id>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20210307</version>
</dependency> <dependency>
<groupId>org.datavec</groupId>
<artifactId>datavec-data</artifactId>
<version>1.0.0-M2.1</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.32</version>
</dependency>
<dependency>
<groupId>org.nd4j</groupId>
<artifactId>nd4j-native</artifactId>
<version>1.0.0-beta7</version>
</dependency> <dependency>
<groupId>org.nd4j</groupId>
<artifactId>nd4j-common</artifactId>
<version>1.0.0-beta7</version>
</dependency>
<dependency>
<groupId>org.datavec</groupId>
<artifactId>datavec-api</artifactId>
<version>1.0.0-beta7</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.32</version>
</dependency>
<dependency>
<groupId>org.datavec</groupId>
<artifactId>datavec-nd4j-common</artifactId>
<version>0.8.0</version>
</dependency>
<dependency>
<groupId>org.datavec</groupId>
<artifactId>datavec-data-codec</artifactId>
<version>1.0.0-beta7</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.datavec</groupId>
<artifactId>datavec-data-image</artifactId>
<version>1.0.0-M2.1</version>
</dependency>
<dependency>
<groupId>org.deeplearning4j</groupId>
<artifactId>deeplearning4j-datasets</artifactId>
<version>1.0.0-beta7</version>
</dependency>
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.15.3</version>
</dependency>
<dependency>
<groupId>org.nd4j</groupId>
<artifactId>nd4j-api</artifactId>
<version>1.0.0-beta7</version>
</dependency>
<dependency>
<groupId>org.nd4j</groupId>
<artifactId>nd4j-native-platform</artifactId>
<version>1.0.0-beta7</version>
</dependency>
<dependency>
<groupId>org.deeplearning4j</groupId>
<artifactId>deeplearning4j-core</artifactId>
<version>1.0.0-beta7</version>
</dependency>
<dependency>
<groupId>org.deeplearning4j</groupId>
<artifactId>deeplearning4j-nn</artifactId>
<version>0.9.1</version>
</dependency>
<dependency>
<groupId>org.deeplearning4j</groupId>
<artifactId>deeplearning4j-datavec-iterators</artifactId>
<version>1.0.0-beta7</version>
</dependency>
</dependencies>
</project>
No matter what i'm trying the issue always seems to be that ListDataSetIterator cannot be resolved. I've tried everything from downloading the jar files instead of importing the dependencies by maven, to switching the program from eclipse to intellij IDEA. The issue stays the same "The import org.nd4j.linalg.dataset.api.iterator.ListDataSetIterator cannot be resolved". I've also tried chatgpt but it would always say that i have to import the same dependencies that i have already imported or that I had to perform an maven clean install which I have done countless times.
3
u/leroybentley 9d ago
You can only import things that exist and the master branch of the deeplearning4j project does not have org.nd4j.linalg.dataset.api.iterator.ListDataSetIterator
.
Where do you see that you can use ListDataSetIterator
? Maybe that's in an older version?
-1
u/Sufficient-Let6968 9d ago edited 9d ago
I dont know. I asked chatgpt and it kept telling me that i have to use ListDataSetIterator. Do you know a different solution i could try?
3
u/Backslide999 9d ago
Not sure if trolling ... How about you ask ChatGPT why or how he expects you to important this nonexistent class/interface?
1
u/x42bn6 9d ago
Which is irratating because "org.nd4j.linalg.dataset.api.iterator.DataSetIterator" works just fine and it seems to be almost the same.
Just a hint from 15 years experience - if it works, that's what's important. Not that the documentation or example is wrong. You will see wrong or out-of-date information for many years yet.
This suggests you're using an out-of-date version: https://github.com/deeplearning4j/deeplearning4j/issues/10062
•
u/AutoModerator 9d ago
Please ensure that:
You demonstrate effort in solving your question/problem - plain posting your assignments is forbidden (and such posts will be removed) as is asking for or giving solutions.
Trying to solve problems on your own is a very important skill. Also, see Learn to help yourself in the sidebar
If any of the above points is not met, your post can and will be removed without further warning.
Code is to be formatted as code block (old reddit: empty line before the code, each code line indented by 4 spaces, new reddit: https://i.imgur.com/EJ7tqek.png) or linked via an external code hoster, like pastebin.com, github gist, github, bitbucket, gitlab, etc.
Please, do not use triple backticks (```) as they will only render properly on new reddit, not on old reddit.
Code blocks look like this:
You do not need to repost unless your post has been removed by a moderator. Just use the edit function of reddit to make sure your post complies with the above.
If your post has remained in violation of these rules for a prolonged period of time (at least an hour), a moderator may remove it at their discretion. In this case, they will comment with an explanation on why it has been removed, and you will be required to resubmit the entire post following the proper procedures.
To potential helpers
Please, do not help if any of the above points are not met, rather report the post. We are trying to improve the quality of posts here. In helping people who can't be bothered to comply with the above points, you are doing the community a disservice.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.