H2O POJO causing javac java.lang.IllegalArgumentException - javac

I have a distributed random forest POJO model using the default model setting except for:
ntrees = 150
max_depth = 50
min_rows = 5
Here are the full settings:
buildModel 'drf', {"model_id":"drf-335270ee-8970-4855-b521-c4fb4ca184f5","training_frame":"frame_0.750","validation_frame":"frame_0.250","nfolds":0,"response_column":"DENIAL","ignored_columns":["tx_match_date"],"ignore_const_cols":true,"ntrees":"150","max_depth":"50","min_rows":"5","nbins":20,"seed":-1,"mtries":-1,"sample_rate":0.6320000290870667,"score_each_iteration":true,"score_tree_interval":0,"balance_classes":false,"nbins_top_level":1024,"nbins_cats":1024,"r2_stopping":1.7976931348623157e+308,"stopping_rounds":0,"stopping_metric":"AUTO","stopping_tolerance":0.001,"max_runtime_secs":0,"checkpoint":"","col_sample_rate_per_tree":1,"min_split_improvement":0.00001,"histogram_type":"AUTO","categorical_encoding":"AUTO","build_tree_one_node":false,"sample_rate_per_class":[],"binomial_double_trees":true,"col_sample_rate_change_per_level":1,"calibrate_model":false}
When I try to compile the pojo with:
$javac -cp "h2o-genmodel.jar" -J-Xmx2g -J-XX:MaxPermSize=128m drf_335270ee_8970_4855_b521_c4fb4ca184f5.java
I get the following error.
An exception has occurred in the compiler (1.8.0_131). Please file a bug against the Java compiler via the Java bug reporting page (http://bugreport.java.com) after checking the Bug Database (http://bugs.java.com) for duplicates. Include your program and the following diagnostic in your report. Thank you.
java.lang.IllegalArgumentException
at java.nio.ByteBuffer.allocate(ByteBuffer.java:334)
at com.sun.tools.javac.util.BaseFileManager$ByteBufferCache.get(BaseFileManager.java:325)
at com.sun.tools.javac.util.BaseFileManager.makeByteBuffer(BaseFileManager.java:294)
at com.sun.tools.javac.file.RegularFileObject.getCharContent(RegularFileObject.java:114)
at com.sun.tools.javac.file.RegularFileObject.getCharContent(RegularFileObject.java:53)
at com.sun.tools.javac.main.JavaCompiler.readSource(JavaCompiler.java:602)
at com.sun.tools.javac.main.JavaCompiler.parse(JavaCompiler.java:665)
at com.sun.tools.javac.main.JavaCompiler.parseFiles(JavaCompiler.java:950)
at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:857)
at com.sun.tools.javac.main.Main.compile(Main.java:523)
at com.sun.tools.javac.main.Main.compile(Main.java:381)
at com.sun.tools.javac.main.Main.compile(Main.java:370)
at com.sun.tools.javac.main.Main.compile(Main.java:361)
at com.sun.tools.javac.Main.compile(Main.java:56)
at com.sun.tools.javac.Main.main(Main.java:42)
I don't get this error when replacing the DRF model with a deep learning pojo that I have also downloaded from h2o's Flow UI, so I'm thinking it is likely related to the drf_335270ee_8970_4855_b521_c4fb4ca184f5.java file (note that the POJO was too big to preview in H2O's Flow UI). What could be going on here?
Thanks

Instead of trying to compile an H2O random forest POJO, you can download and use a MOJO instead in almost exactly the same way without needing the compile step.
See:
http://docs.h2o.ai/h2o/latest-stable/h2o-genmodel/javadoc/index.html

Related

Errors - bootstrap GLM model - glmmBoot package

I'm trying to run a bootstrap resampling on a GLM model, but I keep running into errors and I can't find any solution online.
The first problem in which I ran into is "variable lenght differs" when i try to use a normalized variable (sub.size_z) and a continuous variable trasformed into factor (hours). I checked my dataset and there are no NAs anywhere, so i don't know how to tackle the problem.
The second error is "Error: Naming mismatch from base to list of coefs", which happens when i try to run the bootstrap using a GLM without having trasformed the variables that i previously mentioned.
Can anyone point me towards a solution? Thanks a lot!
Here's the code I used!
data <-read.delim2("C:/Users/BRIZ_/Desktop/analisi scratching/Hypothesis 3/Hypothesis 3/database.txt")
library(car)
library(lme4)
library(MASS)
library(dplyr)
library(blmeco)
library(MuMIn)
library(lmerTest)
library(AER)
library(DHARMa)
sub.size_z<-scale(sub.size, center=TRUE,scale=TRUE)
hours<- as.factor(hour)
modelboot<-glmmTMB(sc.count~ offset(log(DURATION)) + hours + general.activity + sub.size_z + approach5+ id,data=data, family=genpois(link = "log"))
summary(modelboot)
bootstrap_model(modelboot,base_data=data,resamples =100)

How to use EOBI simple binary encoding

I am trying to use the sbeTool with the Eurex codecs:
JAVA -Dsbe.target.namespace=eobiV81 -classpath "../sbe-tool-1.7.0.jar;../agrona-0.9.6.jar" uk.co.real_logic.sbe.SbeTool eobi81.xml
This eobi.xml file looks slightly different from the sample provided and the tool execution fails (it succeeds on the the car.xml example file):
Exception in thread "main" java.lang.NullPointerException
at uk.co.real_logic.sbe.xml.XmlSchemaParser.getAttributeValue(XmlSchemaParser.java:221)
at uk.co.real_logic.sbe.xml.MessageSchema.<init>(MessageSchema.java:47)
at uk.co.real_logic.sbe.xml.XmlSchemaParser.parse(XmlSchemaParser.java:105)
at uk.co.real_logic.sbe.SbeTool.parseSchema(SbeTool.java:274)
at uk.co.real_logic.sbe.SbeTool.main(SbeTool.java:199)
Can anyone help me find a way to get the xml compiling? I believe maybe the eobi.xsd file should be useful, but not sure how.
Thanks
Eurex EOBI is not compliant with the SBE 1.0 standard. You can see this if schema validation is turned on for the SBE Tool. To parse Eurex messages you will need a different codec.

TensorflowJS TFJS error: The dtype of dict

Had tried to run https://glitch.com/~tar-understood-exoplanet
and the model would fail to load and I wouldn't be able to use enable the webcam.
Anyone had the same issue?
While the program is running, in the console I get the following:
tfjs:2 Uncaught (in promise) Error: The dtype of dict['image_tensor'] provided in model.execute(dict) must be int32, but was float32
at Object.b [as assert] (tfjs:2)
at tfjs:2
at Array.forEach (<anonymous>)
at t.checkInputShapeAndType (tfjs:2)
at t.<anonymous> (tfjs:2)
at tfjs:2
at Object.next (tfjs:2)
at tfjs:2
at new Promise (<anonymous>)
at Zv (tfjs:2)
I have a Macbook Pro and some other people on their Windows also had some issues running the model. We also tried it on different browsers, Safari and Chrome.
SUCCESS! after switching to coco-ssd 2.0.2:
I added the version 2.0.2 in line 62 as follows:
<script src="https://cdn.jsdelivr.net/npm/#tensorflow-models/coco-ssd#2.0.2"></script>
This is caused by the warmup run of coco-ssd that uses tf.zeros tensor. The default dtype for tf.zeros is 'float' in the recent release of TFJS.
I have put out a new version with fixes. It should work if you use the latest version of coco-ssd (2.0.2) in the glitch example (index.html) as following.
<!-- Load the coco-ssd model to use to recognize things in images -->
<script src="https://cdn.jsdelivr.net/npm/#tensorflow-models/coco-ssd#2.0.2"></script>
Same error here, just occured since Friday night (04/03/2020)
TFModel works well in past few weeks.
I got the same error.
My Scenerio:
I trained a pre-trained model from tensorflow model zoo using transfer learning using tensorflow api as saved model (model.pb file) and converted it into tfjs format (model.json and shared .bin files).
When I tried running this model.json on the javascript(web), it gives the below error:
Uncaught (in promise) Error: The dtype of dict['input_tensor'] provided in model.execute(dict) must be int32, but was float32
When I tried someone else's working converted model (model.json and shared .bin files) on my javascript(web), it worked.
Conclusion:
There is something wrong with my converted model. I converted it using tensorflowjs_converter. My original model in (model.pb) works accurately in python too.
I'm still trying out to convert my model.pb file with different tensorflowjs_converters as it seems to be the converters versioning issue.

Xamarin.Android binding generation giving "Type X was not found" errors for classes new in JDK 1.8

I'm trying to get Xamarin.Android to generate bindings for a library supplied as an AAR. JAR2XML is giving me a lot of "can't find type" errors, so I thought I'd try class-parse, but in addition to some library references I'm trying to track down, I'm getting a couple of these:
1> Error while processing '[Method] java.time.temporal.Temporal adjustInto(java.time.temporal.Temporal temporal, long newValue)' in '[Class] java.time.temporal.ChronoField': Type 'java.time.temporal.Temporal' was not found. (TaskId:69)
1> Error while processing '[Method] java.time.temporal.Temporal addTo(java.time.temporal.Temporal temporal, long amount)' in '[Class] java.time.temporal.ChronoUnit': Type 'java.time.temporal.Temporal' was not found. (TaskId:69)
Now, java.time.temporal.Temporal is a new type in JDK 1.8, so I'm wondering if maybe that's part of my problem here (ie. maybe the types that can't load are using other new-in-1.8 types). Running bin\javac -version in the path specified in Options-Xamarin-Android Settings says I'm using "1.8.0_172". My project is targeting "Android 8.1 (Oreo)" - ie. api level 27. Is there some other option I need to set to make sure I'm using 1.8?

Get warnings when programmatically parsing Dart file with analyzer_experimental

I am using analyzer_experimental to parse a Dart file into a CompilationUnit:
import 'package:analyzer_experimental/analyzer.dart';
var unit;
try {
unit = parseDartFile(path);
} on AnalyzerErrorGroup catch(e){
print(e);
}
The above code will catch any parsing errors encountered.
I am also interested in seeing any warnings associated with the file (e.g. 'Undefined name "foo"'). I know that the experimental_analyzer library has the capability to generate these warnings when running from the command line but it does not seem to be possible to get the warnings programmatically, without directly referencing classes in the src folder (which seems like a bad idea).
Is there any way to achieve this?
It's likely this package was very incomplete at the time.
There's now an analyzer package on pub and also a (work-in-progress) STDIN/STDOUT Analyzer Service aimed to help making tooling support easier for IDE extension authors.

Resources