Skip to content

Instantly share code, notes, and snippets.

View geekprogramming's full-sized avatar

Geek Programming geekprogramming

View GitHub Profile
Exception in thread "main" java.lang.ExceptionInInitializerError
at com.ftu.data.LPData.forceNumericalStability(LPData.java:88)
at com.ftu.cnn.ConvolutionalNetRun.main(ConvolutionalNetRun.java:24)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intellij.uiDesigner.snapShooter.SnapShooter.main(SnapShooter.java:59)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
// Predict function
public static int[][] toIntArrayArray(BufferedImage image) {
int w = image.getWidth();
int h = image.getHeight();
int[][] ret = new int[h][w];
int j;
if(image.getRaster().getNumDataElements() == 1) {
WritableRaster i = image.getRaster();
for(j = 0; j < h; ++j) {
public Model saveModel() throws IOException {
log.info("Save model............");
OutputStream fos = Files.newOutputStream(Paths.get(Config.FILE_PARAMS));
DataOutputStream dos = new DataOutputStream(fos);
Nd4j.write(model.params(), dos);
dos.flush();
dos.close();
FileUtils.writeStringToFile(new File(Config.FILE_MODEL), model.getLayerWiseConfigurations().toJson());
return this;
}
<?xml version="1.0" encoding="UTF-8"?>
<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>com.ftu</groupId>
<artifactId>ANPR</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.ldt.plateregconition;
import java.io.DataInputStream;
import java.io.DataOutputStream;
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.ldt.plateregconition;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.File;