Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Full example for MxNet #332

Open
yunge opened this issue Dec 9, 2016 · 17 comments
Open

Full example for MxNet #332

yunge opened this issue Dec 9, 2016 · 17 comments

Comments

@yunge
Copy link

yunge commented Dec 9, 2016

Current MxNet example is just show how to do prediction, please add some example code for creating model & training, thanks.

MxNet has full featured cpp examples, such as
https://github.com/dmlc/MXNet.cpp/blob/master/example/mlp.cpp

@saudet
Copy link
Member

saudet commented Dec 9, 2016

Sure, contributions are welcome! If you try to port that code, but are having issues, please let me know, thanks!

@yunge
Copy link
Author

yunge commented Dec 9, 2016

I tried some simple code, but had jvm crashed:

SymbolHandle sym_h = new SymbolHandle();
MXSymbolCreateVariable("X", new PointerPointer(sym_h));
MXSymbolFree(sym_h);

Is there any problem in the code?
I use windows, so I compiled libmxnet.dll first then generate jnimxnet.dll, and the prediction example is just fine.

The error log:

 A fatal error has been detected by the Java Runtime Environment:

  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ffe6e12d45d, pid=4192, tid=0x0000000000000b78

 JRE version: Java(TM) SE Runtime Environment (8.0_111-b14) (build 1.8.0_111-b14)
 Java VM: Java HotSpot(TM) 64-Bit Server VM (25.111-b14 mixed mode windows-amd64 compressed oops)
 Problematic frame:
 C  [libmxnet.dll+0x2d45d]

 Failed to write core dump. Minidumps are not enabled by default on client versions of Windows

 If you would like to submit a bug report, please visit:
   http://bugreport.java.com/bugreport/crash.jsp
 The crash happened outside the Java Virtual Machine in native code.
 See problematic frame for where to report the bug.


---------------  T H R E A D  ---------------

Current thread (0x0000000003628000):  JavaThread "main" [_thread_in_native, id=2936, stack(0x0000000003150000,0x0000000003250000)]

siginfo: ExceptionCode=0xc0000005, writing address 0x0000000000000000

Registers:
RAX=0x000000000000000f, RBX=0x0000000001573490, RCX=0x0000000000000000, RDX=0x0000000000000000
RSP=0x000000000324e8b0, RBP=0x000000000324ea10, RSI=0x000000000324e8d8, RDI=0x0000000000000000
R8 =0x0000000000000000, R9 =0x0000000000000000, R10=0x0000000001572f40, R11=0x0000000000000000
R12=0x0000000000000000, R13=0x000000001577dd08, R14=0x0000000000000000, R15=0x0000000003628000
RIP=0x00007ffe6e12d45d, EFLAGS=0x0000000000010287

Top of Stack: (sp=0x000000000324e8b0)
0x000000000324e8b0:   000000000324e8d8 0000000001573490
0x000000000324e8c0:   0000000000000000 00000000015764b0
0x000000000324e8d0:   0000000001573490 0000000000000000
0x000000000324e8e0:   0000000000000000 0000000000000000
0x000000000324e8f0:   fffffffffffffffe 0000000003628000
0x000000000324e900:   0000000000000058 00007ffe790e17b1
0x000000000324e910:   0000000000000001 000000000000000f
0x000000000324e920:   00003c798f5705e5 00000000015764b0
0x000000000324e930:   000000000324ea18 00000000015764b0
0x000000000324e940:   00000000036281f8 00007ffe79100abd
0x000000000324e950:   000000000324ea10 00000000036281f8
0x000000000324e960:   0000000000000000 0000000000200021
0x000000000324e970:   000000000372835d 0000000003737f74
0x000000000324e980:   000000001577dd08 000000000324e9f0
0x000000000324e990:   0000000000200021 0000000003628000
0x000000000324e9a0:   000000000324ea80 0000000003737ca2 

Instructions: (pc=0x00007ffe6e12d45d)
0x00007ffe6e12d43d:   48 83 f9 08 73 06 e8 d8 e2 4a 00 cc 48 83 f9 27
0x00007ffe6e12d44d:   76 06 e8 cc e2 4a 00 cc 48 8b c8 e8 33 8a 48 00
0x00007ffe6e12d45d:   49 89 1e 33 c0 eb 04 48 83 c8 ff 48 8b 4c 24 70
0x00007ffe6e12d46d:   48 33 cc e8 5b 92 48 00 48 8b 9c 24 b0 00 00 00 


Register to memory mapping:

RAX=0x000000000000000f is an unknown value
RBX=0x0000000001573490 is an unknown value
RCX=0x0000000000000000 is an unknown value
RDX=0x0000000000000000 is an unknown value
RSP=0x000000000324e8b0 is pointing into the stack for thread: 0x0000000003628000
RBP=0x000000000324ea10 is pointing into the stack for thread: 0x0000000003628000
RSI=0x000000000324e8d8 is pointing into the stack for thread: 0x0000000003628000
RDI=0x0000000000000000 is an unknown value
R8 =0x0000000000000000 is an unknown value
R9 =0x0000000000000000 is an unknown value
R10=0x0000000001572f40 is an unknown value
R11=0x0000000000000000 is an unknown value
R12=0x0000000000000000 is an unknown value
R13={method} {0x000000001577dd10} 'MXSymbolCreateVariable' '(Ljava/lang/String;Lorg/bytedeco/javacpp/PointerPointer;)I' in 'ml/mxnet'
R14=0x0000000000000000 is an unknown value
R15=0x0000000003628000 is a thread


Stack: [0x0000000003150000,0x0000000003250000],  sp=0x000000000324e8b0,  free space=1018k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [libmxnet.dll+0x2d45d]
C  [jnimxnet.dll+0x20abd]
C  0x0000000003737f74

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  ml.mxnet.MXSymbolCreateVariable(Ljava/lang/String;Lorg/bytedeco/javacpp/PointerPointer;)I+0
j  test.main([Ljava/lang/String;)V+34
v  ~StubRoutines::call_stub
j  sun.reflect.NativeMethodAccessorImpl.invoke0(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+0
j  sun.reflect.NativeMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+100
j  sun.reflect.DelegatingMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+6
j  java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+56
j  com.intellij.rt.execution.application.AppMain.main([Ljava/lang/String;)V+170
v  ~StubRoutines::call_stub

---------------  P R O C E S S  ---------------

Java Threads: ( => current thread )
  0x0000000017e87800 JavaThread "JavaCPP Deallocator" daemon [_thread_blocked, id=9276, stack(0x000000001f9a0000,0x000000001faa0000)]
  0x0000000017f57000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, id=12196, stack(0x0000000018480000,0x0000000018580000)]
  0x0000000015d6d800 JavaThread "Service Thread" daemon [_thread_blocked, id=12840, stack(0x00000000179d0000,0x0000000017ad0000)]
  0x0000000015d40800 JavaThread "C1 CompilerThread2" daemon [_thread_blocked, id=11284, stack(0x00000000178d0000,0x00000000179d0000)]
  0x0000000017113800 JavaThread "C2 CompilerThread1" daemon [_thread_blocked, id=11120, stack(0x00000000177d0000,0x00000000178d0000)]
  0x0000000015d26000 JavaThread "C2 CompilerThread0" daemon [_thread_blocked, id=11856, stack(0x00000000176d0000,0x00000000177d0000)]
  0x0000000015d39800 JavaThread "Attach Listener" daemon [_thread_blocked, id=11988, stack(0x00000000175d0000,0x00000000176d0000)]
  0x0000000015d37000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=7540, stack(0x00000000174d0000,0x00000000175d0000)]
  0x000000000371c800 JavaThread "Finalizer" daemon [_thread_blocked, id=8444, stack(0x0000000016f70000,0x0000000017070000)]
  0x0000000003717000 JavaThread "Reference Handler" daemon [_thread_blocked, id=11080, stack(0x0000000016e70000,0x0000000016f70000)]
=>0x0000000003628000 JavaThread "main" [_thread_in_native, id=2936, stack(0x0000000003150000,0x0000000003250000)]

Other Threads:
  0x0000000015cd6800 VMThread [stack: 0x0000000016d70000,0x0000000016e70000] [id=4868]
  0x00000000171db800 WatcherThread [stack: 0x0000000017ad0000,0x0000000017bd0000] [id=8128]

VM state:not at safepoint (normal execution)

VM Mutex/Monitor currently owned by a thread: None

Heap:
 PSYoungGen      total 18944K, used 6245K [0x00000000eb300000, 0x00000000ec800000, 0x0000000100000000)
  eden space 16384K, 38% used [0x00000000eb300000,0x00000000eb919508,0x00000000ec300000)
  from space 2560K, 0% used [0x00000000ec580000,0x00000000ec580000,0x00000000ec800000)
  to   space 2560K, 0% used [0x00000000ec300000,0x00000000ec300000,0x00000000ec580000)
 ParOldGen       total 44032K, used 0K [0x00000000c1800000, 0x00000000c4300000, 0x00000000eb300000)
  object space 44032K, 0% used [0x00000000c1800000,0x00000000c1800000,0x00000000c4300000)
 Metaspace       used 4235K, capacity 4956K, committed 5248K, reserved 1056768K
  class space    used 472K, capacity 528K, committed 640K, reserved 1048576K

Card table byte_map: [0x0000000012ae0000,0x0000000012ce0000] byte_map_base: 0x00000000124d4000

Marking Bits: (ParMarkBitMap*) 0x00000000573ca6c0
 Begin Bits: [0x0000000013230000, 0x00000000141d0000)
 End Bits:   [0x00000000141d0000, 0x0000000015170000)

Polling page: 0x00000000014a0000

CodeCache: size=245760Kb used=1797Kb max_used=1797Kb free=243962Kb
 bounds [0x0000000003720000, 0x0000000003990000, 0x0000000012720000]
 total_blobs=531 nmethods=261 adapters=183
 compilation: enabled

Compilation events (10 events):
Event: 11.562 Thread 0x0000000015d40800 nmethod 256 0x00000000038ddc10 code [0x00000000038ddf80, 0x00000000038e02d8]
Event: 11.562 Thread 0x0000000015d40800  258       3       sun.misc.URLClassPath::getResource (83 bytes)
Event: 11.563 Thread 0x0000000015d40800 nmethod 258 0x00000000038c8a10 code [0x00000000038c8ba0, 0x00000000038c8f68]
Event: 11.563 Thread 0x0000000015d40800  257       3       java.lang.ClassLoader::getClassLoadingLock (35 bytes)
Event: 11.563 Thread 0x0000000015d26000 nmethod 259 0x00000000038db810 code [0x00000000038db940, 0x00000000038dba98]
Event: 11.563 Thread 0x0000000015d40800 nmethod 257 0x00000000038db150 code [0x00000000038db2c0, 0x00000000038db688]
Event: 11.568 Thread 0x0000000015d40800  260   !   3       java.net.URL::set (114 bytes)
Event: 11.569 Thread 0x0000000015d40800 nmethod 260 0x00000000038dbd50 code [0x00000000038dbf40, 0x00000000038dca78]
Event: 11.569 Thread 0x0000000015d40800  261       3       java.io.File::<init> (113 bytes)
Event: 11.571 Thread 0x0000000015d40800 nmethod 261 0x00000000038e1cd0 code [0x00000000038e1f40, 0x00000000038e2cb8]

GC Heap History (0 events):
No events

Deoptimization events (1 events):
Event: 0.512 Thread 0x0000000003628000 Uncommon trap: reason=unstable_if action=reinterpret pc=0x000000000382d3e0 method=java.lang.String.hashCode()I @ 14

Internal exceptions (6 events):
Event: 0.038 Thread 0x0000000003628000 Exception <a 'java/lang/NoSuchMethodError': Method sun.misc.Unsafe.defineClass(Ljava/lang/String;[BII)Ljava/lang/Class; name or signature does not match> (0x00000000eb307c78) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u111\7883\hotspot\
Event: 0.038 Thread 0x0000000003628000 Exception <a 'java/lang/NoSuchMethodError': Method sun.misc.Unsafe.prefetchRead(Ljava/lang/Object;J)V name or signature does not match> (0x00000000eb307f60) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u111\7883\hotspot\src\share\vm\prims
Event: 0.617 Thread 0x0000000003628000 Exception <a 'java/security/PrivilegedActionException'> (0x00000000eb6e4df0) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u111\7883\hotspot\src\share\vm\prims\jvm.cpp, line 1386]
Event: 0.617 Thread 0x0000000003628000 Exception <a 'java/security/PrivilegedActionException'> (0x00000000eb6e5000) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u111\7883\hotspot\src\share\vm\prims\jvm.cpp, line 1386]
Event: 0.618 Thread 0x0000000003628000 Exception <a 'java/security/PrivilegedActionException'> (0x00000000eb6e8c48) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u111\7883\hotspot\src\share\vm\prims\jvm.cpp, line 1386]
Event: 0.618 Thread 0x0000000003628000 Exception <a 'java/security/PrivilegedActionException'> (0x00000000eb6e8e58) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u111\7883\hotspot\src\share\vm\prims\jvm.cpp, line 1386]

Events (10 events):
Event: 11.498 loading class ml/mxnet$NativeOpInfo$Forward_int_PointerPointer_IntPointer_PointerPointer_IntPointer_Pointer done
Event: 11.558 loading class ml/mxnet$NativeOpInfo
Event: 11.558 loading class ml/mxnet$NativeOpInfo done
Event: 11.559 loading class ml/mxnet$ExecutorMonitorCallback
Event: 11.559 loading class ml/mxnet$ExecutorMonitorCallback done
Event: 11.559 loading class java/lang/NumberFormatException
Event: 11.559 loading class java/lang/NumberFormatException done
Event: 11.559 loading class org/bytedeco/javacpp/Pointer$DeallocatorThread
Event: 11.559 loading class org/bytedeco/javacpp/Pointer$DeallocatorThread done
Event: 11.561 Thread 0x0000000017e87800 Thread added: 0x0000000017e87800


Dynamic libraries:
0x00007ff632190000 - 0x00007ff6321c7000 	C:\Program Files\Java\jdk1.8.0\bin\java.exe
0x00007ffe98970000 - 0x00007ffe98b41000 	C:\WINDOWS\SYSTEM32\ntdll.dll
0x00007ffe98890000 - 0x00007ffe9893b000 	C:\WINDOWS\System32\KERNEL32.DLL
0x00007ffe95370000 - 0x00007ffe9558d000 	C:\WINDOWS\System32\KERNELBASE.dll
0x00007ffe96d10000 - 0x00007ffe96db2000 	C:\WINDOWS\System32\ADVAPI32.dll
0x00007ffe96750000 - 0x00007ffe967ee000 	C:\WINDOWS\System32\msvcrt.dll
0x00007ffe96ca0000 - 0x00007ffe96cf9000 	C:\WINDOWS\System32\sechost.dll
0x00007ffe96330000 - 0x00007ffe96451000 	C:\WINDOWS\System32\RPCRT4.dll
0x00007ffe98720000 - 0x00007ffe98885000 	C:\WINDOWS\System32\USER32.dll
0x00007ffe94ec0000 - 0x00007ffe94ede000 	C:\WINDOWS\System32\win32u.dll
0x00007ffe98570000 - 0x00007ffe985a4000 	C:\WINDOWS\System32\GDI32.dll
0x00007ffe95590000 - 0x00007ffe95712000 	C:\WINDOWS\System32\gdi32full.dll
0x00007ffe90900000 - 0x00007ffe90b79000 	C:\WINDOWS\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.14393.447_none_42191651c6827bb3\COMCTL32.dll
0x00007ffe96480000 - 0x00007ffe96747000 	C:\WINDOWS\System32\combase.dll
0x00007ffe95270000 - 0x00007ffe95365000 	C:\WINDOWS\System32\ucrtbase.dll
0x00007ffe94ee0000 - 0x00007ffe94f4a000 	C:\WINDOWS\System32\bcryptPrimitives.dll
0x00007ffe98940000 - 0x00007ffe9896e000 	C:\WINDOWS\System32\IMM32.DLL
0x0000000057640000 - 0x0000000057712000 	C:\Program Files\Java\jdk1.8.0\jre\bin\msvcr100.dll
0x0000000056bb0000 - 0x000000005744a000 	C:\Program Files\Java\jdk1.8.0\jre\bin\server\jvm.dll
0x00007ffe96860000 - 0x00007ffe96868000 	C:\WINDOWS\System32\PSAPI.DLL
0x00007ffe93290000 - 0x00007ffe932b3000 	C:\WINDOWS\SYSTEM32\WINMM.dll
0x00007ffe90c20000 - 0x00007ffe90c2a000 	C:\WINDOWS\SYSTEM32\VERSION.dll
0x00007ffe7f020000 - 0x00007ffe7f029000 	C:\WINDOWS\SYSTEM32\WSOCK32.dll
0x00007ffe95f00000 - 0x00007ffe95f6a000 	C:\WINDOWS\System32\WS2_32.dll
0x00007ffe93230000 - 0x00007ffe9325b000 	C:\WINDOWS\SYSTEM32\WINMMBASE.dll
0x00007ffe95e00000 - 0x00007ffe95e42000 	C:\WINDOWS\System32\cfgmgr32.dll
0x0000000057630000 - 0x000000005763f000 	C:\Program Files\Java\jdk1.8.0\jre\bin\verify.dll
0x0000000057600000 - 0x0000000057629000 	C:\Program Files\Java\jdk1.8.0\jre\bin\java.dll
0x0000000056b90000 - 0x0000000056ba6000 	C:\Program Files\Java\jdk1.8.0\jre\bin\zip.dll
0x00007ffe96dc0000 - 0x00007ffe982c9000 	C:\WINDOWS\System32\SHELL32.dll
0x00007ffe95720000 - 0x00007ffe95dfa000 	C:\WINDOWS\System32\windows.storage.dll
0x00007ffe94dd0000 - 0x00007ffe94e1c000 	C:\WINDOWS\System32\powrprof.dll
0x00007ffe98510000 - 0x00007ffe98562000 	C:\WINDOWS\System32\shlwapi.dll
0x00007ffe94e30000 - 0x00007ffe94e3f000 	C:\WINDOWS\System32\kernel.appcore.dll
0x00007ffe95e50000 - 0x00007ffe95ef9000 	C:\WINDOWS\System32\shcore.dll
0x00007ffe94e40000 - 0x00007ffe94e54000 	C:\WINDOWS\System32\profapi.dll
0x00007ffe8bf50000 - 0x00007ffe8bf60000 	C:\Program Files (x86)\IntelliJ IDEA\bin\breakgen64.dll
0x0000000056b70000 - 0x0000000056b8a000 	C:\Program Files\Java\jdk1.8.0\jre\bin\net.dll
0x00007ffe945d0000 - 0x00007ffe9462c000 	C:\WINDOWS\system32\mswsock.dll
0x00007ffe6e100000 - 0x00007ffe6e79a000 	D:\software\mxnet\build\Release\libmxnet.dll
0x00007ffe86f60000 - 0x00007ffe86f8e000 	C:\WINDOWS\SYSTEM32\VCOMP140.DLL
0x000000006d7c0000 - 0x000000006f99b000 	C:\WINDOWS\SYSTEM32\libopenblas.dll
0x0000000061440000 - 0x000000006145c000 	C:\WINDOWS\SYSTEM32\libgcc_s_seh-1.dll
0x0000000019550000 - 0x0000000019691000 	C:\WINDOWS\SYSTEM32\libgfortran-3.dll
0x000000006cf00000 - 0x000000006cf58000 	C:\WINDOWS\SYSTEM32\libquadmath-0.dll
0x00007ffe790e0000 - 0x00007ffe79137000 	C:\Windows\jnimxnet.dll
0x00007ffe8ae70000 - 0x00007ffe8ae86000 	C:\WINDOWS\SYSTEM32\VCRUNTIME140.dll
0x00007ffe67d20000 - 0x00007ffe67eb2000 	C:\WINDOWS\SYSTEM32\dbghelp.dll

VM Arguments:
jvm_args: -Didea.launcher.port=7532 -Didea.launcher.bin.path=C:\Program Files (x86)\IntelliJ IDEA\bin -Dfile.encoding=UTF-8 
java_command: com.intellij.rt.execution.application.AppMain test
java_class_path (initial): C:\Program Files\Java\jdk1.8.0\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.8.0\jre\lib\ext\access-bridge-64.jar;C:\Program Files\Java\jdk1.8.0\jre\lib\ext\cldrdata.jar;C:\Program Files\Java\jdk1.8.0\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.8.0\jre\lib\ext\jaccess.jar;C:\Program Files\Java\jdk1.8.0\jre\lib\ext\jfxrt.jar;C:\Program Files\Java\jdk1.8.0\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.8.0\jre\lib\ext\nashorn.jar;C:\Program Files\Java\jdk1.8.0\jre\lib\ext\sunec.jar;C:\Program Files\Java\jdk1.8.0\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.8.0\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk1.8.0\jre\lib\ext\sunpkcs11.jar;C:\Program Files\Java\jdk1.8.0\jre\lib\ext\zipfs.jar;C:\Program Files\Java\jdk1.8.0\jre\lib\javaws.jar;C:\Program Files\Java\jdk1.8.0\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0\jre\lib\jfxswt.jar;C:\Program Files\Java\jdk1.8.0\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0\jre\lib\management-agent.jar;C:\Program Files\Java\jdk1.8.0\jre\lib\plugin.jar;C:\Program Files\Java\jdk1.8.0\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0\jre\lib\rt.jar;C:\build\fquant\classes\main;C:\build\fquant\resources\main;D:\jianguo\fquant\lib\sis-jhdf5-batteries_included.jar;C:\build\fbase\classes\main;D:\OneDrive\software\dev\.gradle\caches\modules-2\files-2.1\org.jetbrains.kotlin\kotlin-stdlib\1.1-M03\1c4aa4b0dab7b4c111934f34e6506812d7e974a2\kotlin-stdlib-1.1-M03.jar;D:\OneDrive\software\dev\.gradle\caches\modules-2\files-2.1\org.nd4j\nd4j-cuda-8.0-platform\0.7.1\48485a0a0bff9c4f4ae20992804267fca11d8be7\nd4j-cuda-8.0-platform-0.7.1.jar;D:\OneDrive\software\dev\.gradle\caches\modules-2\files-2.1\org.nd4j\nd4j-native-platform\0.7.1\b4ddc7774843d873ad5141265b7b72eb58a23590\nd4j-native-platform-0.7.1.jar;D:\OneDrive\software\dev\.gradle\caches\modules-2\files-2.1\net.openhft\chronicle-map\3.
Launcher Type: SUN_STANDARD

Environment Variables:
JAVA_HOME=C:\Program Files\Java\jdk1.8.0
PATH=C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\Git\cmd;C:\Program Files (x86)\Calibre2\;C:\Program Files (x86)\Graphviz2.38\bin;C:\Program Files\Anaconda3;C:\Program Files\Anaconda3\Scripts;C:\Program Files\Anaconda3\Library\bin;C:\Program Files\nodejs\;D:\OneDrive\software\dev\apache-maven\bin;C:\Program Files\Java\jdk1.8.0\bin;C:\Users\f\AppData\Local\atom\bin;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Program Files\CMake\bin;C:\Users\f\AppData\Local\Microsoft\WindowsApps;C:\Users\f\AppData\Roaming\npm
USERNAME=f
OS=Windows_NT
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 58 Stepping 9, GenuineIntel



---------------  S Y S T E M  ---------------

OS: Windows 10.0 , 64 bit Build 14393 (10.0.14393.0)

CPU:total 4 (2 cores per cpu, 2 threads per core) family 6 model 58 stepping 9, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, avx, clmul, erms, ht, tsc, tscinvbit, tscinv

Memory: 4k page, physical 4090216k(1126924k free), swap 6318440k(1825040k free)

vm_info: Java HotSpot(TM) 64-Bit Server VM (25.111-b14) for windows-amd64 JRE (1.8.0_111-b14), built on Sep 22 2016 19:24:05 by "java_re" with MS VC++ 10.0 (VS2010)

time: Fri Dec 09 09:59:10 2016
elapsed time: 12 seconds (0d 0h 0m 12s)

@saudet
Copy link
Member

saudet commented Dec 9, 2016

I don't know, could you also provide the code in C that you are trying to port?

@saudet
Copy link
Member

saudet commented Dec 9, 2016

BTW, if you have a working build for Windows, please consider making a contribution and send a pull request for that! Alternatively, you could collaborate with @Neiko2002 and his pull request #309. Thanks

@yunge
Copy link
Author

yunge commented Dec 9, 2016

The cpp code is from https://github.com/dmlc/MXNet.cpp/blob/master/example/mlp.cpp

auto sym_x = Symbol::Variable("X");


The definition of Symbol in "mxnet-cpp/symbol.hpp":
/*! \brief handle to a symbol that can be bind as operator */
typedef void *SymbolHandle;
......
Symbol::Symbol(SymbolHandle handle) {
  blob_ptr_ = std::make_shared<SymBlob>(handle);
}
Symbol::Symbol(const char *name) {
  SymbolHandle handle;
  CHECK_EQ(MXSymbolCreateVariable(name, &(handle)), 0);
  blob_ptr_ = std::make_shared<SymBlob>(handle);
}
Symbol::Symbol(const std::string &name) : Symbol(name.c_str()) {}
Symbol Symbol::Variable(const std::string &name) { return Symbol(name); }

The MXSymbolCreateVariable is in mxnet C API.

@saudet
Copy link
Member

saudet commented Dec 9, 2016

It looks like what you want to do is this then:

SymbolHandle sym_h = new SymbolHandle();
MXSymbolCreateVariable("X", sym_h);
MXSymbolFree(sym_h);

@saudet
Copy link
Member

saudet commented Dec 9, 2016

Hum, it looks like that declaration is missing.

@saudet saudet added the bug label Dec 9, 2016
@yunge
Copy link
Author

yunge commented Dec 9, 2016

Yes, that's what I really want, I'll test it when it fixed.
Thanks for your hard working.

saudet added a commit that referenced this issue Dec 18, 2016
 * Add functions missing from the presets of MXNet (issue #332)
@saudet
Copy link
Member

saudet commented Dec 18, 2016

Ok, I've fixed the issue in the commit above.

Let me know if you encounter any other issues and thanks for looking into this!

@yunge
Copy link
Author

yunge commented Dec 19, 2016

Thanks! I'll try it.

@yunge
Copy link
Author

yunge commented Dec 23, 2016

Could you please check these code:

SymbolHandle sym = new SymbolHandle();
int num = 0;
String[] strs = {};
int result = MXSymbolListOutputs(sym, new IntPointer(num), new PointerPointer(strs));

I got jvm crashed. Again, is there any problem in the code?

@saudet
Copy link
Member

saudet commented Dec 23, 2016 via email

@yunge
Copy link
Author

yunge commented Dec 23, 2016

My mistake, I should use a real Symbol. I'll keep going with other functions.
Sorry for waste your time.

@saudet
Copy link
Member

saudet commented Jan 17, 2018

@yunge Have you made any progress? Is it working well now with MXNet 1.0.0? Or are there remaining issues?

@yunge
Copy link
Author

yunge commented Jan 17, 2018

@saudet Hi, I don't use javacpp now.

@saudet
Copy link
Member

saudet commented Jan 17, 2018

@yunge What are you using these days?

@yunge
Copy link
Author

yunge commented Jan 19, 2018

@saudet I use python api directly.

@saudet saudet removed the bug label Dec 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants