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
相关推荐
星落梦生3 小时前
SpringAOP基础笔记(7)
java·开发语言
金銀銅鐵4 小时前
带您看懂字节码指令(四):一条指令里有什么
java·jvm
最强小杰4 小时前
某 OpenAI 兼容网关上的 `kimi-k3.1-pro`:Cline、Zed 接入与 SSE 排错示例
java·服务器·网络·ai
Flynn Liang5 小时前
流量治理不是限流那么简单:I/O 密集型 Java 服务的 6 层防线
java·微服务·高并发·限流·熔断·系统稳定性·resilience4j
学长毕设5 小时前
基于SpringBoot智慧养老服务平台设计与实现-附源码
java·spring boot·后端
曹牧5 小时前
Java:“刷新雪崩”
java·开发语言
秋天的怀念_David5 小时前
算法一千零一夜 · 第三十三夜 · 跳表
java·程序人生·算法
Forget the Dream7 小时前
Spring AI 2.0 系列(二):第一个 ChatClient——从注入到一次完整调用
java·人工智能·spring boot·ai·springai
黑十8 小时前
FDE 怎么快速搭一个可演示页面?最小前端方案
java·大数据·前端·数据库·人工智能
神明不懂浪漫9 小时前
【第八章】多线程(一)
java·开发语言·经验分享·笔记