You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to run training a caffe model from java. I need to generate a lmdb database on the fly. There is some python code http://deepdish.io/2015/04/28/creating-lmdb-in-python/ which can do it, but in java I can not do the same since Datum class does not have method "SerializeToString()". Another approach I tried is using "MemoryData" data layer, and feed training data directly to the model:
SolverParameter solver_param = new SolverParameter();
ReadProtoFromTextFileOrDie(path/to/solver, solver_param);
FloatSolver solver = FloatSolverRegistry.CreateSolver(solver_param);
FloatMemoryDataLayer input = solver.net().layer_by_name(FloatMemoryDataLayer.class, 'mnist');
MatVector matVector = new MatVector();
IntPointer intPoiter = new IntPointer();
Mat img = opencv_imgcodecs.imread(path_to_img, opencv_imgcodecs.IMREAD_GRAYSCALE);
Mat img_res_float = new Mat();
img.convertTo(img_res_float, opencv_core.CV_32FC1);
matVector.put(img_res_float);
intPoiter.put(new Integer(0));
input.AddMatVector(matVector, intPoiter);
solver.Solve(new BytePointer());
but at line intPoiter.put(new Integer(0));
I get an error "Exception in thread "main" java.lang.NullPointerException: This pointer address is NULL." Could you please suggest something.
The text was updated successfully, but these errors were encountered:
If I write input1.AddMatVector(matVector, new IntPointer(1));
I get the following error: F0407 11:34:50.119905 6363 blob.cpp:32] Check failed: shape[i] >= 0 (-1527131614 vs. 0)
It seems something wrong with the shape of the mat, but I checked, it is ok: (1,28,28)
I am trying to run training a caffe model from java. I need to generate a lmdb database on the fly. There is some python code http://deepdish.io/2015/04/28/creating-lmdb-in-python/ which can do it, but in java I can not do the same since Datum class does not have method "SerializeToString()". Another approach I tried is using "MemoryData" data layer, and feed training data directly to the model:
Prototxt of the model:
but at line
intPoiter.put(new Integer(0));
I get an error "Exception in thread "main" java.lang.NullPointerException: This pointer address is NULL." Could you please suggest something.
The text was updated successfully, but these errors were encountered: