Search code examples
javadeep-learningdeeplearning4jdl4j

Caused by: java.net.UnknownHostException: blob.deeplearning4j.org problem with deeplearning4j


I would like to run the dl4jexamples/modelimport/ImportDeepMoji.java but it throws an exception

Caused by: java.net.UnknownHostException: blob.deeplearning4j.org

how can i address this issue?

this is the complete error log

Downloading model to C:\Users\DELLLA~1\AppData\Local\Temp\dl4j_keras\deepmoji_model.h5
Exception in thread "main" java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.intellij.rt.execution.CommandLineWrapper.main(CommandLineWrapper.java:66)
Caused by: java.net.UnknownHostException: blob.deeplearning4j.org
    at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:184)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
    at java.net.Socket.connect(Socket.java:589)
    at java.net.Socket.connect(Socket.java:538)
    at sun.net.NetworkClient.doConnect(NetworkClient.java:180)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:432)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:527)
    at sun.net.www.http.HttpClient.<init>(HttpClient.java:211)
    at sun.net.www.http.HttpClient.New(HttpClient.java:308)
    at sun.net.www.http.HttpClient.New(HttpClient.java:326)
    at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1202)
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1138)
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1032)
    at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:966)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1546)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1474)
    at java.net.URL.openStream(URL.java:1045)
    at org.apache.commons.io.FileUtils.copyURLToFile(FileUtils.java:1478)
    at org.deeplearning4j.examples.modelimport.keras.ImportDeepMoji.main(ImportDeepMoji.java:57)
    ... 5 more

Thanks in advance


Solution

  • Replace this

    String modelUrl = "http://blob.deeplearning4j.org/models/deepmoji.h5";
    

    to

    String modelUrl = "https://dl4jdata.blob.core.windows.net/models/deepmoji.h5";
    

    Then it should work !