DL4J无法下载MNIST数据集解决 Server returned HTTP response code: 403 for URL解决方法

报错情况

报错如下:

复制代码
16:45:41.463 [main] INFO org.nd4j.nativeblas.Nd4jBlas - Number of threads used for OpenMP BLAS: 6
16:45:41.497 [main] INFO org.nd4j.linalg.api.ops.executioner.DefaultOpExecutioner - Backend used: [CPU]; OS: [Windows 10]
16:45:41.497 [main] INFO org.nd4j.linalg.api.ops.executioner.DefaultOpExecutioner - Cores: [12]; Memory: [7.1GB];
16:45:41.497 [main] INFO org.nd4j.linalg.api.ops.executioner.DefaultOpExecutioner - Blas vendor: [OPENBLAS]
16:45:41.536 [main] INFO org.deeplearning4j.datasets.base.MnistFetcher - Downloading MNIST...
Exception in thread "main" java.io.IOException: Server returned HTTP response code: 403 for URL: https://dl4jdata.blob.core.windows.net/datasets/mnist/train-images-idx3-ubyte.gz
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1900)
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1498)
	at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:268)
	at org.apache.commons.io.FileUtils.copyURLToFile(FileUtils.java:1506)
	at org.nd4j.common.resources.Downloader.downloadAndExtract(Downloader.java:121)
	at org.nd4j.common.resources.Downloader.downloadAndExtract(Downloader.java:113)
	at org.nd4j.common.resources.Downloader.downloadAndExtract(Downloader.java:94)
	at org.deeplearning4j.datasets.base.MnistFetcher.downloadAndUntar(MnistFetcher.java:149)
	at org.deeplearning4j.datasets.fetchers.MnistDataFetcher.<init>(MnistDataFetcher.java:82)
	at org.deeplearning4j.datasets.iterator.impl.MnistDataSetIterator.<init>(MnistDataSetIterator.java:70)
	at org.deeplearning4j.datasets.iterator.impl.MnistDataSetIterator.<init>(MnistDataSetIterator.java:56)
	at com.example.LogisticRegression.main(LogisticRegression.java:45)

Process finished with exit code 1

解决方法

自己下载好MNIST数据集,然后放入DL4J对应的文件夹下。

可以在Java中运行这行代码查看:

java 复制代码
System.out.println(DL4JResources.getDirectory(ResourceType.DATASET, "MNIST").getAbsolutePath());

我的位置如下,仅作参考。

java 复制代码
C:\Users\64859\.deeplearning4j\data\MNIST
相关推荐
笑醉踏歌行1 分钟前
idea应用代码配色网站
java·ide·intellij-idea
一入JAVA毁终身3 分钟前
处理Lombok的一个小BUG
java·开发语言·bug
gjh120815 分钟前
Easy-excel监听器中对批量上传的工单做错误收集
java·spring boot
红衣女妖仙18 分钟前
JXLS 库导出复杂 Excel
java·excel·jxls·java 导出 excel
Hellyc25 分钟前
JAVA八股文:异常有哪些种类,可以举几个例子吗?Throwable类有哪些常见方法?
java·开发语言
西岭千秋雪_34 分钟前
Redis缓存架构实战
java·redis·笔记·学习·缓存·架构
五岳1 小时前
深入研究使用DozerMapper复制List<Ojbect>前后元素类型不一致的问题
java·爬坑
人生在勤,不索何获-白大侠1 小时前
day15——Java常用API(二):常见算法、正则表达式与异常处理详解
java·算法·正则表达式
Bug退退退1231 小时前
RabbitMQ 高级特性之消息确认
java·分布式·rabbitmq
云动雨颤2 小时前
Java并发性能优化|读写锁与互斥锁解析
java