Coding Phase 1.2
Hello!
For implementing UNet, I used sample code (https://github.com/montardon/deeplearning4j) as a template. I decided to implement the code without making any special changes and the same sample dataset. While running this code, Runtime Exception:
We have now started working on the implementation of U-Net using deeplearning4j. Before proceeding further, two tasks needed to be done:
1. Converting the image size to 128 X 128 pixels instead of 188 X 140 pixels. This was required as the convolution layers in U-Net work effectively on this size of input images. Besides for maintaining the height to breadth ratio, it was decided that the images be cropped instead of being resized.
2. In order to understand the working of deeplearning4j, it was necessary to get started with the available dl4j examples. This involved the following steps:
- Clone the git project on deeplearning4j. For this, visit https://deeplearning4j.konduit.ai/getting-started/quickstart
- Use the command prompt to enter the following:
git clone https://github.com/eclipse/deeplearning4j-examples.git
cd dl4j-examples/
mvn clean install
Although one can follow these steps to set up the environment, another method which actually worked out for me involved cloning the git repository on command prompt, importing it in Eclipse IDE as a Maven repository, and then installing it via the Maven clean command. Note to self: It is possible to get an "initialization of boot layer java.lang.LayerInstantiationException: Package jdk.internal.jimage.decompressor in both module java.base and module jrt.fs" error. To resolve this, right-click on the project → Build Path → Configure Build Path. Here, select Java Runtime Environment: JavaSE1.8 and la! the code can now be built and executed.
To top it off, I built and executed the LeNet-MNIST code as instructed by the mentors.
Caused by: java.lang.OutOfMemoryError: Cannot allocate new LongPointer(4): totalBytes = 272, physicalBytes = 2010M, Caused by: java.lang.OutOfMemoryError: Physical memory usage is too high: physicalBytes (2010M) > maxPhysicalBytes (1988M).
To resolve such an error, one can either try to increase the heap size allotted to Eclipse IDE by making corresponding changes in the eclipse.ini file or specifying “VM args” as, -Xmx4096M (for example) in the “Run configuration” of the Eclipse project.
After making the required changes, this error was fixed. Currently, I am trying to improve the model score by training it on our original dataset and reviewing the model hyperparameters.
Further updates in my next post
Auf Wiedersehen!
Comments
Post a Comment