
37 changed files with 1408 additions and 73 deletions
@ -0,0 +1,4 @@
@@ -0,0 +1,4 @@
|
||||
activeProfiles= |
||||
eclipse.preferences.version=1 |
||||
resolveWorkspaceProjects=true |
||||
version=1 |
Binary file not shown.
Binary file not shown.
@ -0,0 +1,33 @@
@@ -0,0 +1,33 @@
|
||||
# |
||||
# A fatal error has been detected by the Java Runtime Environment: |
||||
# |
||||
# SIGSEGV (0xb) at pc=0x00007f70bef27fb2, pid=7672, tid=29649 |
||||
# |
||||
# JRE version: Java(TM) SE Runtime Environment (9.0+11) (build 9.0.4+11) |
||||
# Java VM: Java HotSpot(TM) 64-Bit Server VM (9.0.4+11, mixed mode, tiered, compressed oops, g1 gc, linux-amd64) |
||||
# Problematic frame: |
||||
# C [libjimage.so+0x3fb2] ImageStrings::find(Endian*, char const*, int*, unsigned int)+0x42 |
||||
# |
||||
# Core dump will be written. Default location: Core dumps may be processed with "/usr/share/apport/apport %p %s %c %d %P" (or dumping to /home/dpapp/eclipse-workspace/RunescapeAI/core.7672) |
||||
# |
||||
# If you would like to submit a bug report, please visit: |
||||
# http://bugreport.java.com/bugreport/crash.jsp |
||||
# |
||||
|
||||
--------------- S U M M A R Y ------------ |
||||
|
||||
Command Line: -agentlib:jdwp=transport=dt_socket,suspend=y,address=localhost:36189 -Djava.library.path=/home/dpapp/opencv-3.4.0/build/lib -Dfile.encoding=UTF-8 ObjectDetector |
||||
|
||||
Host: Intel(R) Core(TM) i7-5600U CPU @ 2.60GHz, 4 cores, 7G, Ubuntu 16.04.3 LTS |
||||
Time: Thu Feb 15 22:10:22 2018 EST elapsed time: 55 seconds (0d 0h 0m 55s) |
||||
|
||||
--------------- T H R E A D --------------- |
||||
|
||||
Current thread (0x00007f7058001000): JavaThread "SIGTERM handler" daemon [_thread_in_vm, id=29649, stack(0x00007f7072acd000,0x00007f7072bce000)] |
||||
|
||||
Stack: [0x00007f7072acd000,0x00007f7072bce000], sp=0x00007f7072bcb160, free space=1016k |
||||
Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code) |
||||
C [libjimage.so+0x3fb2] ImageStrings::find(Endian*, char const*, int*, unsigned int)+0x42 |
||||
C [libjimage.so+0x4b8c] ImageFileReader::find_location_index(char const*, unsigned long long*) const+0x3c |
||||
C [libjimage.so+0x505a] JIMAGE_FindResource+0xba |
||||
V [libjvm.so+0x5aae8e] |
@ -0,0 +1,25 @@
@@ -0,0 +1,25 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
||||
<modelVersion>4.0.0</modelVersion> |
||||
<groupId>RunescapeAI</groupId> |
||||
<artifactId>RunescapeAI</artifactId> |
||||
<version>0.0.1-SNAPSHOT</version> |
||||
<build> |
||||
<sourceDirectory>src</sourceDirectory> |
||||
<plugins> |
||||
<plugin> |
||||
<artifactId>maven-compiler-plugin</artifactId> |
||||
<version>3.7.0</version> |
||||
<configuration> |
||||
<release>9</release> |
||||
</configuration> |
||||
</plugin> |
||||
</plugins> |
||||
</build> |
||||
<dependencies> |
||||
<dependency> |
||||
<groupId>org.tensorflow</groupId> |
||||
<artifactId>tensorflow</artifactId> |
||||
<version>1.5.0-rc0</version> |
||||
</dependency> |
||||
</dependencies> |
||||
</project> |
@ -0,0 +1,57 @@
@@ -0,0 +1,57 @@
|
||||
import java.io.IOException; |
||||
import java.nio.file.Files; |
||||
import java.nio.file.Paths; |
||||
|
||||
import org.tensorflow.Graph; |
||||
import org.tensorflow.Session; |
||||
import org.tensorflow.Tensor; |
||||
import org.tensorflow.TensorFlow; |
||||
|
||||
public class HelloTF { |
||||
|
||||
public static void test() throws IOException { |
||||
//Dataset
|
||||
float[] x = new float[]{1}; |
||||
float[] y = x; |
||||
|
||||
//Setting parameters
|
||||
String modelDir = "/home/dpapp/tensorflow-1.5.0/models/raccoon_dataset/results/checkpoint_23826"; |
||||
|
||||
//Reading the graph
|
||||
byte[] graphDef = Files.readAllBytes(Paths.get(modelDir, "frozen_graph_inference.pb")); |
||||
|
||||
Tensor input = Tensor.create(0.5f); |
||||
|
||||
float results = -99999f; |
||||
try (Graph g = new Graph()) { |
||||
g.importGraphDef(graphDef); |
||||
try (Session s = new Session(g); |
||||
Tensor result = s.runner().feed("input", input).fetch("output").run().get(0)) { |
||||
results = result.floatValue(); |
||||
} |
||||
} |
||||
System.out.println("Expected: " + x + "\tPredicted: " + results); |
||||
} |
||||
|
||||
public static void main(String[] args) throws Exception { |
||||
System.out.println("Running helloTF"); |
||||
try (Graph g = new Graph()) { |
||||
final String value = "Hello from " + TensorFlow.version(); |
||||
|
||||
// Construct the computation graph with a single operation, a constant
|
||||
// named "MyConst" with a value "value".
|
||||
try (Tensor t = Tensor.create(value.getBytes("UTF-8"))) { |
||||
// The Java API doesn't yet include convenience functions for adding operations.
|
||||
g.opBuilder("Const", "MyConst").setAttr("dtype", t.dataType()).setAttr("value", t).build(); |
||||
} |
||||
|
||||
// Execute the "MyConst" operation in a Session.
|
||||
try (Session s = new Session(g); |
||||
Tensor output = s.runner().fetch("MyConst").run().get(0)) { |
||||
System.out.println(new String(output.bytesValue(), "UTF-8")); |
||||
} |
||||
} |
||||
|
||||
test(); |
||||
} |
||||
} |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in new issue