|
29 | 29 | import java.nio.charset.StandardCharsets; |
30 | 30 | import java.security.ProtectionDomain; |
31 | 31 | import java.util.ArrayList; |
| 32 | +import java.util.Arrays; |
32 | 33 | import java.util.HashMap; |
33 | 34 | import java.util.LinkedHashMap; |
34 | 35 | import java.util.LinkedList; |
|
59 | 60 | import io.bioimage.modelrunner.utils.CommonUtils; |
60 | 61 | import net.imglib2.Cursor; |
61 | 62 | import net.imglib2.RandomAccessibleInterval; |
62 | | -import net.imglib2.loops.LoopBuilder; |
63 | 63 | import net.imglib2.type.NativeType; |
64 | 64 | import net.imglib2.type.numeric.RealType; |
65 | 65 | import net.imglib2.util.Cast; |
@@ -245,6 +245,7 @@ protected void runFromShmas(List<String> inputs, List<String> outputs) throws IO |
245 | 245 | IValueVector inputsVector = new IValueVector(); |
246 | 246 | for (String ee : inputs) { |
247 | 247 | Map<String, Object> decoded = Types.decode(ee); |
| 248 | + System.out.println("MM: -> " + ee); |
248 | 249 | SharedMemoryArray shma = SharedMemoryArray.read((String) decoded.get(MEM_NAME_KEY)); |
249 | 250 | org.bytedeco.pytorch.Tensor inT = TensorBuilder.build(shma); |
250 | 251 | inputsVector.put(new IValue(inT)); |
@@ -320,6 +321,7 @@ else if (task.status == TaskStatus.CRASHED) { |
320 | 321 | shmaOutputList.add(shm); |
321 | 322 | } |
322 | 323 | RandomAccessibleInterval<T> rai = shm.getSharedRAI(); |
| 324 | + System.out.println("Output size: " + Arrays.asList(rai.dimensionsAsLongArray())); |
323 | 325 | // TODO remove |
324 | 326 | double max0 = 0; |
325 | 327 | Cursor<T> iter0 = Views.iterable(rai).cursor(); |
@@ -430,6 +432,7 @@ private <T extends RealType<T> & NativeType<T>> List<String> encodeInputs(List<T |
430 | 432 | List<String> encodedInputTensors = new ArrayList<String>(); |
431 | 433 | Gson gson = new Gson(); |
432 | 434 | for (Tensor<T> tt : inputTensors) { |
| 435 | + System.out.println("Input size: " + Arrays.asList(tt.getData().dimensionsAsLongArray())); |
433 | 436 | SharedMemoryArray shma = SharedMemoryArray.createSHMAFromRAI(tt.getData(), false, true); |
434 | 437 | shmaInputList.add(shma); |
435 | 438 | HashMap<String, Object> map = new HashMap<String, Object>(); |
|
0 commit comments