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


    报错情况

    报错如下:

    1. 16:45:41.463 [main] INFO org.nd4j.nativeblas.Nd4jBlas - Number of threads used for OpenMP BLAS: 6
    2. 16:45:41.497 [main] INFO org.nd4j.linalg.api.ops.executioner.DefaultOpExecutioner - Backend used: [CPU]; OS: [Windows 10]
    3. 16:45:41.497 [main] INFO org.nd4j.linalg.api.ops.executioner.DefaultOpExecutioner - Cores: [12]; Memory: [7.1GB];
    4. 16:45:41.497 [main] INFO org.nd4j.linalg.api.ops.executioner.DefaultOpExecutioner - Blas vendor: [OPENBLAS]
    5. 16:45:41.536 [main] INFO org.deeplearning4j.datasets.base.MnistFetcher - Downloading MNIST...
    6. 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
    7. at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1900)
    8. at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1498)
    9. at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:268)
    10. at org.apache.commons.io.FileUtils.copyURLToFile(FileUtils.java:1506)
    11. at org.nd4j.common.resources.Downloader.downloadAndExtract(Downloader.java:121)
    12. at org.nd4j.common.resources.Downloader.downloadAndExtract(Downloader.java:113)
    13. at org.nd4j.common.resources.Downloader.downloadAndExtract(Downloader.java:94)
    14. at org.deeplearning4j.datasets.base.MnistFetcher.downloadAndUntar(MnistFetcher.java:149)
    15. at org.deeplearning4j.datasets.fetchers.MnistDataFetcher.<init>(MnistDataFetcher.java:82)
    16. at org.deeplearning4j.datasets.iterator.impl.MnistDataSetIterator.<init>(MnistDataSetIterator.java:70)
    17. at org.deeplearning4j.datasets.iterator.impl.MnistDataSetIterator.<init>(MnistDataSetIterator.java:56)
    18. at com.example.LogisticRegression.main(LogisticRegression.java:45)
    19. Process finished with exit code 1

    解决方法

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

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

    System.out.println(DL4JResources.getDirectory(ResourceType.DATASET, "MNIST").getAbsolutePath());

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

    C:\Users\64859\.deeplearning4j\data\MNIST

  • 相关阅读:
    CSS基础(二)
    润和软件DAYU 200的OpenHarmony赋能之旅
    Guava Preconditions类的各种用法
    前端工作总结215-混入思路
    【Keil】编译选项设置 Warning 为 error
    linux查看python的py文件的命令
    Kafka知识点整理
    2022年9月18日 9点 程序爱生活 纳指会修正反弹,很大概率继续往下, 恒指也不可避免。
    stm32 串口不通调试总结
    韩顺平-零钱通项目
  • 原文地址:https://blog.csdn.net/m0_46948660/article/details/134167829