Hello,
I wish to apply a RandomZoom for the segmentation problem. I have written in the config json
{
“name”: “RandomZoom”,
“args”:
{
“image_field”: “image”,
“label_field”: “label”,
“lower_limits”: [0.90, 0.9, 0.90],
“upper_limits”: [1.20, 1.20, 1.20],
“use_gpu”: “True”,
“keep_size”: “True”,
“probability”: 0.1
}
},
but i am encounter a crash which i am unable to decipher. The error message starts with:
Traceback (most recent call last):
File “libs/data/chain_transformer.py”, line 20, in _apply_one_transform
File “components/transforms/random_zoom.py”, line 60, in transform
File “libs/transforms/spatial_zoomer.py”, line 169, in zoom
File “libs/transforms/multi_format_transformer.py”, line 78, in transform
File “libs/transforms/spatial_zoomer.py”, line 72, in _handle_cdhw
File “libs/transforms/spatial_zoomer.py”, line 62, in _zoom
File “<array_function internals>”, line 6, in pad
File “/usr/local/lib/python3.6/dist-packages/numpy/lib/arraypad.py”, line 741, in pad
pad_width = _as_pairs(pad_width, array.ndim, as_index=True)
File “/usr/local/lib/python3.6/dist-packages/numpy/lib/arraypad.py”, line 516, in _as_pairs
return np.broadcast_to(x, (ndim, 2)).tolist()
File “<array_function internals>”, line 6, in broadcast_to
File “/usr/local/lib/python3.6/dist-packages/numpy/lib/stride_tricks.py”, line 182, in broadcast_to
return _broadcast_to(array, shape, subok=subok, readonly=True)
File “/usr/local/lib/python3.6/dist-packages/numpy/lib/stride_tricks.py”, line 127, in _broadcast_to
op_flags=[‘readonly’], itershape=shape, order=‘C’)
ValueError: operands could not be broadcast together with remapped shapes [original->remapped]: (3,2) and requested shape (4,2)
2021-01-27 12:13:22,586 - ChainTransformer - ERROR - Error occurred while applying <class ‘ai4med.components.transforms.random_zoom.RandomZoom’> to following data dict.
…
[[0. 0. 0. … 0. 0. 0.]
[0. 0. 0. … 0. 0. 0.]
[0. 0. 0. … 0. 0. 0.]
…
[0. 0. 0. … 0. 0. 0.]
[0. 0. 0. … 0. 0. 0.]
[0. 0. 0. … 0. 0. 0.]]
[[0. 0. 0. … 0. 0. 0.]
[0. 0. 0. … 0. 0. 0.]
[0. 0. 0. … 0. 0. 0.]
…
any help welcome.
Regards
krishnan