Alexandre Brown04/03/2022, 5:45 AM
I tried chunking it to batches of 4 but I still hit 5GB RAM usage from this line
mk.ndarray(it, batchSize, 3, targetHeight, targetWidth)
Pavel Gorgulov04/03/2022, 12:50 PM
This will still increase memory consumption, but not by that much. The problem is general and related to boxing/unboxing. Adding methods for
val arr: Array<Float> ... arr.toFloatArray()
is not difficult and they will appear in the new release as soon as I am done with kotlin-native and build for Arm.
Alexandre Brown04/03/2022, 1:18 PM
is a list of FloatArray. Basically I have images that get preprocessed using KotlinDL, each image gives a FloatArray, then I convert the images (list of FloatArray) to a MultiArray<Float, D4> using MultiK Let me try your suggestion of using Arrays.
Pavel Gorgulov04/03/2022, 2:03 PM