# # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x0000000133cf0fbb, pid=19618, tid=5891 # # JRE version: OpenJDK Runtime Environment (11.0.2+9) (build 11.0.2+9) # Java VM: OpenJDK 64-Bit Server VM (11.0.2+9, mixed mode, tiered, compressed oops, g1 gc, bsd-amd64) # Problematic frame: # C [libtensorflow_cc.2.dylib+0x8228fbb] TF_TensorData+0xb # # No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again # # An error report file with more information is saved as: # /Users/jakob/proj/tfjava031/hs_err_pid19618.log # # 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. #
Are there any examples that show the usage of the Java framework API for basic workflow like this?
training_images = training_images/255.0 test_images = test_images/255.0 model = tf.keras.models.Sequential([#tf.keras.layers.Flatten(), tf.keras.layers.Dense(64, activation=tf.nn.relu), tf.keras.layers.Dense(10, activation=tf.nn.softmax)]) model.compile(optimizer = 'adam', loss = 'sparse_categorical_crossentropy') model.fit(training_images, training_labels, epochs=5) model.evaluate(test_images, test_labels) classifications = model.predict(test_images)
Specifically, I don't see the equivalent of
Placeholder. Do I invoke
Ops.tensorArray()of the same size as the placeholder, then populate that, then eventually invoke
Runner.feed(placeholder, array)? Or is there a better way?
TFloat32either an empty one, or by copying from some source. Then feed it to the placeholder. Note the empty one returns memory which has not been zeroed yet tensorflow/java#271.
model.fit()until I get something working.... then I can move
model.fit()to Java and
model.predict()would always sit in Java.
So to some extent it depends how complicated your model is. Tribuo's next release exposes TF models but wraps up all the fitting, evaluation and prediction in it's interface to make it a lot simpler. It's not the same as Keras, it's a little bit more like scikit-learn as we don't have callbacks in Tribuo.
However TF-Java will have this in the future, it's just a lot of stuff to build with a much smaller team than the Keras team.
int32. Other parts are
float64. Any ideas?