javavisualizationdeeplearning4j

Visualizing training progresss in deeplearning4j throws error when starting server


I was following this tutorial trying to visualize my models training progress: https://deeplearning4j.konduit.ai/tuning-and-training/visualization The simple code for the server setup is:

UIServer uiServer = UIServer.getInstance();
StatsStorage statsStorage = new InMemoryStatsStorage(); 
uiServer.attach(statsStorage);
model.setListeners(new StatsListener(statsStorage));

Then you should be able to see it on http://localhost:9000/train/overview However I get following error when the server is starting and am unsure what to make of it:

12:39:05.063 [main] DEBUG org.deeplearning4j.ui.VertxUIServer - Deeplearning4j UI server is starting.
12:39:05.084 [main] DEBUG io.netty.util.internal.logging.InternalLoggerFactory - Using SLF4J as the default logging framework
12:39:05.085 [main] DEBUG io.netty.util.ResourceLeakDetector - -Dio.netty.leakDetection.level: simple
12:39:05.085 [main] DEBUG io.netty.util.ResourceLeakDetector - -Dio.netty.leakDetection.targetRecords: 4
12:39:05.093 [main] DEBUG io.netty.util.internal.InternalThreadLocalMap - -Dio.netty.threadLocalMap.stringBuilder.initialSize: 1024
12:39:05.093 [main] DEBUG io.netty.util.internal.InternalThreadLocalMap - -Dio.netty.threadLocalMap.stringBuilder.maxSize: 4096
12:39:05.098 [main] DEBUG io.netty.channel.MultithreadEventLoopGroup - -Dio.netty.eventLoopThreads: 16
12:39:05.114 [main] DEBUG io.netty.channel.nio.NioEventLoop - -Dio.netty.noKeySetOptimization: false
12:39:05.114 [main] DEBUG io.netty.channel.nio.NioEventLoop - -Dio.netty.selectorAutoRebuildThreshold: 512
12:39:05.123 [main] DEBUG io.netty.util.internal.PlatformDependent - Platform: Windows
12:39:05.124 [main] DEBUG io.netty.util.internal.PlatformDependent0 - -Dio.netty.noUnsafe: false
12:39:05.124 [main] DEBUG io.netty.util.internal.PlatformDependent0 - Java version: 14
12:39:05.125 [main] DEBUG io.netty.util.internal.PlatformDependent0 - sun.misc.Unsafe.theUnsafe: available
12:39:05.125 [main] DEBUG io.netty.util.internal.PlatformDependent0 - sun.misc.Unsafe.copyMemory: available
12:39:05.125 [main] DEBUG io.netty.util.internal.PlatformDependent0 - java.nio.Buffer.address: available
12:39:05.128 [main] DEBUG io.netty.util.internal.PlatformDependent0 - direct buffer constructor: unavailable
java.lang.UnsupportedOperationException: Reflective setAccessible(true) disabled
    at io.netty.util.internal.ReflectionUtil.trySetAccessible(ReflectionUtil.java:31)
    at io.netty.util.internal.PlatformDependent0$4.run(PlatformDependent0.java:225)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:312)
    at io.netty.util.internal.PlatformDependent0.<clinit>(PlatformDependent0.java:219)
    at io.netty.util.internal.PlatformDependent.isAndroid(PlatformDependent.java:289)
    at io.netty.util.internal.PlatformDependent.<clinit>(PlatformDependent.java:92)
    at io.netty.channel.nio.NioEventLoop.newTaskQueue0(NioEventLoop.java:279)
    at io.netty.channel.nio.NioEventLoop.newTaskQueue(NioEventLoop.java:150)
    at io.netty.channel.nio.NioEventLoop.<init>(NioEventLoop.java:138)
    at io.netty.channel.nio.NioEventLoopGroup.newChild(NioEventLoopGroup.java:146)
    at io.netty.channel.nio.NioEventLoopGroup.newChild(NioEventLoopGroup.java:37)
    at io.netty.util.concurrent.MultithreadEventExecutorGroup.<init>(MultithreadEventExecutorGroup.java:84)
    at io.netty.util.concurrent.MultithreadEventExecutorGroup.<init>(MultithreadEventExecutorGroup.java:58)
    at io.netty.util.concurrent.MultithreadEventExecutorGroup.<init>(MultithreadEventExecutorGroup.java:47)
    at io.netty.channel.MultithreadEventLoopGroup.<init>(MultithreadEventLoopGroup.java:59)
    at io.netty.channel.nio.NioEventLoopGroup.<init>(NioEventLoopGroup.java:86)
    at io.netty.channel.nio.NioEventLoopGroup.<init>(NioEventLoopGroup.java:81)
    at io.netty.channel.nio.NioEventLoopGroup.<init>(NioEventLoopGroup.java:68)
    at io.vertx.core.net.impl.transport.Transport.eventLoopGroup(Transport.java:153)
    at io.vertx.core.impl.VertxImpl.<init>(VertxImpl.java:143)
    at io.vertx.core.impl.VertxImpl.vertx(VertxImpl.java:92)
    at io.vertx.core.impl.VertxFactoryImpl.vertx(VertxFactoryImpl.java:40)
    at io.vertx.core.impl.VertxFactoryImpl.vertx(VertxFactoryImpl.java:32)
    at io.vertx.core.impl.VertxFactoryImpl.vertx(VertxFactoryImpl.java:27)
    at io.vertx.core.Vertx.vertx(Vertx.java:75)
    at org.deeplearning4j.ui.VertxUIServer.deploy(VertxUIServer.java:188)
    at org.deeplearning4j.ui.VertxUIServer.deploy(VertxUIServer.java:159)
    at org.deeplearning4j.ui.VertxUIServer.getInstance(VertxUIServer.java:130)
    at org.deeplearning4j.ui.VertxUIServer.getInstance(VertxUIServer.java:95)
    at org.deeplearning4j.ui.api.UIServer.getInstance(UIServer.java:70)
    at org.deeplearning4j.ui.api.UIServer.getInstance(UIServer.java:50)
    at Environment.<init>(Environment.java:106)
    at LSTMMain.main(LSTMMain.java:40)
12:39:05.129 [main] DEBUG io.netty.util.internal.PlatformDependent0 - java.nio.Bits.unaligned: available, true
12:39:05.129 [main] DEBUG io.netty.util.internal.PlatformDependent0 - jdk.internal.misc.Unsafe.allocateUninitializedArray(int): unavailable
java.lang.IllegalAccessException: class io.netty.util.internal.PlatformDependent0$6 cannot access class jdk.internal.misc.Unsafe (in module java.base) because module java.base does not export jdk.internal.misc to unnamed module @6134ac4a
    at java.base/jdk.internal.reflect.Reflection.newIllegalAccessException(Reflection.java:376)
    at java.base/java.lang.reflect.AccessibleObject.checkAccess(AccessibleObject.java:647)
    at java.base/java.lang.reflect.Method.invoke(Method.java:556)
    at io.netty.util.internal.PlatformDependent0$6.run(PlatformDependent0.java:335)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:312)
    at io.netty.util.internal.PlatformDependent0.<clinit>(PlatformDependent0.java:326)
    at io.netty.util.internal.PlatformDependent.isAndroid(PlatformDependent.java:289)
    at io.netty.util.internal.PlatformDependent.<clinit>(PlatformDependent.java:92)
    at io.netty.channel.nio.NioEventLoop.newTaskQueue0(NioEventLoop.java:279)
    at io.netty.channel.nio.NioEventLoop.newTaskQueue(NioEventLoop.java:150)
    at io.netty.channel.nio.NioEventLoop.<init>(NioEventLoop.java:138)
    at io.netty.channel.nio.NioEventLoopGroup.newChild(NioEventLoopGroup.java:146)
    at io.netty.channel.nio.NioEventLoopGroup.newChild(NioEventLoopGroup.java:37)
    at io.netty.util.concurrent.MultithreadEventExecutorGroup.<init>(MultithreadEventExecutorGroup.java:84)
    at io.netty.util.concurrent.MultithreadEventExecutorGroup.<init>(MultithreadEventExecutorGroup.java:58)
    at io.netty.util.concurrent.MultithreadEventExecutorGroup.<init>(MultithreadEventExecutorGroup.java:47)
    at io.netty.channel.MultithreadEventLoopGroup.<init>(MultithreadEventLoopGroup.java:59)
    at io.netty.channel.nio.NioEventLoopGroup.<init>(NioEventLoopGroup.java:86)
    at io.netty.channel.nio.NioEventLoopGroup.<init>(NioEventLoopGroup.java:81)
    at io.netty.channel.nio.NioEventLoopGroup.<init>(NioEventLoopGroup.java:68)
    at io.vertx.core.net.impl.transport.Transport.eventLoopGroup(Transport.java:153)
    at io.vertx.core.impl.VertxImpl.<init>(VertxImpl.java:143)
    at io.vertx.core.impl.VertxImpl.vertx(VertxImpl.java:92)
    at io.vertx.core.impl.VertxFactoryImpl.vertx(VertxFactoryImpl.java:40)
    at io.vertx.core.impl.VertxFactoryImpl.vertx(VertxFactoryImpl.java:32)
    at io.vertx.core.impl.VertxFactoryImpl.vertx(VertxFactoryImpl.java:27)
    at io.vertx.core.Vertx.vertx(Vertx.java:75)
    at org.deeplearning4j.ui.VertxUIServer.deploy(VertxUIServer.java:188)
    at org.deeplearning4j.ui.VertxUIServer.deploy(VertxUIServer.java:159)
    at org.deeplearning4j.ui.VertxUIServer.getInstance(VertxUIServer.java:130)
    at org.deeplearning4j.ui.VertxUIServer.getInstance(VertxUIServer.java:95)
    at org.deeplearning4j.ui.api.UIServer.getInstance(UIServer.java:70)
    at org.deeplearning4j.ui.api.UIServer.getInstance(UIServer.java:50)
    at Environment.<init>(Environment.java:106)
    at LSTMMain.main(LSTMMain.java:40)
12:39:05.130 [main] DEBUG io.netty.util.internal.PlatformDependent0 - java.nio.DirectByteBuffer.<init>(long, int): unavailable
12:39:05.130 [main] DEBUG io.netty.util.internal.PlatformDependent - sun.misc.Unsafe: available
12:39:05.143 [main] DEBUG io.netty.util.internal.PlatformDependent - maxDirectMemory: 4294967296 bytes (maybe)
12:39:05.143 [main] DEBUG io.netty.util.internal.PlatformDependent - -Dio.netty.tmpdir: C:\Users\David\AppData\Local\Temp (java.io.tmpdir)
12:39:05.144 [main] DEBUG io.netty.util.internal.PlatformDependent - -Dio.netty.bitMode: 64 (sun.arch.data.model)
12:39:05.144 [main] DEBUG io.netty.util.internal.PlatformDependent - -Dio.netty.maxDirectMemory: -1 bytes
12:39:05.144 [main] DEBUG io.netty.util.internal.PlatformDependent - -Dio.netty.uninitializedArrayAllocationThreshold: -1
12:39:05.145 [main] DEBUG io.netty.util.internal.CleanerJava9 - java.nio.ByteBuffer.cleaner(): available
12:39:05.145 [main] DEBUG io.netty.util.internal.PlatformDependent - -Dio.netty.noPreferDirect: false
12:39:05.150 [main] DEBUG io.netty.util.internal.PlatformDependent - org.jctools-core.MpscChunkedArrayQueue: available
12:39:05.241 [main] DEBUG io.netty.resolver.dns.DefaultDnsServerAddressStreamProvider - Default DNS servers: [/192.168.0.1:53, /0.0.0.0:53, /192.168.2.1:53] (sun.net.dns.ResolverConfiguration)
12:39:05.381 [vert.x-eventloop-thread-0] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.numHeapArenas: 16
12:39:05.381 [vert.x-eventloop-thread-0] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.numDirectArenas: 16
12:39:05.381 [vert.x-eventloop-thread-0] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.pageSize: 8192
12:39:05.381 [vert.x-eventloop-thread-0] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.maxOrder: 11
12:39:05.381 [vert.x-eventloop-thread-0] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.chunkSize: 16777216
12:39:05.381 [vert.x-eventloop-thread-0] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.tinyCacheSize: 512
12:39:05.381 [vert.x-eventloop-thread-0] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.smallCacheSize: 256
12:39:05.381 [vert.x-eventloop-thread-0] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.normalCacheSize: 64
12:39:05.381 [vert.x-eventloop-thread-0] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.maxCachedBufferCapacity: 32768
12:39:05.381 [vert.x-eventloop-thread-0] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.cacheTrimInterval: 8192
12:39:05.381 [vert.x-eventloop-thread-0] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.cacheTrimIntervalMillis: 0
12:39:05.381 [vert.x-eventloop-thread-0] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.useCacheForAllThreads: true
12:39:05.381 [vert.x-eventloop-thread-0] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.maxCachedByteBuffersPerChunk: 1023
12:39:05.403 [vert.x-eventloop-thread-0] DEBUG io.netty.util.NetUtil - -Djava.net.preferIPv4Stack: false
12:39:05.403 [vert.x-eventloop-thread-0] DEBUG io.netty.util.NetUtil - -Djava.net.preferIPv6Addresses: false
12:39:05.410 [vert.x-eventloop-thread-0] DEBUG io.netty.util.NetUtil - Loopback interface: lo (Software Loopback Interface 1, 127.0.0.1)
12:39:05.411 [vert.x-eventloop-thread-0] DEBUG io.netty.util.NetUtil - Failed to get SOMAXCONN from sysctl and file \proc\sys\net\core\somaxconn. Default: 200
12:39:05.444 [vert.x-eventloop-thread-0] DEBUG io.netty.channel.DefaultChannelId - -Dio.netty.processId: 9660 (auto-detected)
12:39:05.459 [vert.x-eventloop-thread-0] DEBUG io.netty.channel.DefaultChannelId - -Dio.netty.machineId: d0:37:45:ff:fe:22:ee:b3 (auto-detected)
12:39:05.472 [vert.x-eventloop-thread-0] DEBUG io.netty.buffer.ByteBufUtil - -Dio.netty.allocator.type: pooled
12:39:05.473 [vert.x-eventloop-thread-0] DEBUG io.netty.buffer.ByteBufUtil - -Dio.netty.threadLocalDirectBufferSize: 0
12:39:05.473 [vert.x-eventloop-thread-0] DEBUG io.netty.buffer.ByteBufUtil - -Dio.netty.maxThreadLocalCharBufferSize: 16384
12:39:05.487 [vert.x-eventloop-thread-0] INFO org.deeplearning4j.ui.VertxUIServer - Deeplearning4j UI server started at: http://localhost:9000
12:39:05.490 [main] INFO org.deeplearning4j.ui.VertxUIServer - StatsStorage instance attached to UI: InMemoryStatsStorage(uid=bd548909)
12:39:05.803 [Thread-5] INFO org.deeplearning4j.ui.VertxUIServer - Deeplearning4j UI server is auto-stopping after thread (name: main) died.
12:39:05.812 [vert.x-eventloop-thread-0] INFO org.deeplearning4j.ui.VertxUIServer - Deeplearning4j UI server stopped.

Following this post: java.lang.UnsupportedOperationException: Reflective setAccessible(true) disabled I tried to set the Java version to 8 but it didn't help

Any ideas what I could try?


Solution

  • 12:39:05.487 [vert.x-eventloop-thread-0] INFO org.deeplearning4j.ui.VertxUIServer - Deeplearning4j UI server started at: http://localhost:9000` 
    12:39:05.490 [main] INFO org.deeplearning4j.ui.VertxUIServer - StatsStorage instance attached to UI: InMemoryStatsStorage(uid=bd548909)
    12:39:05.803 [Thread-5] INFO org.deeplearning4j.ui.VertxUIServer - Deeplearning4j UI server is auto-stopping after thread (name: main) died.
    

    The server has started, ran for about 500ms and then shut down, because the main thread of your application has ended.

    So if you want to keep it running, you need to keep your main thread alive.

    You can do that for example with a Thread.sleep(60000) to keep it running for another minute.