python_for_microscopists icon indicating copy to clipboard operation
python_for_microscopists copied to clipboard

Expand dimension of patched training image

Open TinSn50 opened this issue 1 year ago • 0 comments

Without expanding dimension the following error comes up in while executing code block 33: example = train_dataset[0] for k,v in example.items(): print(k,v.shape)

ValueError Traceback (most recent call last) in <cell line: 1>() ----> 1 example = train_dataset[0] 2 for k,v in example.items(): 3 print(k,v.shape)

6 frames /usr/local/lib/python3.10/dist-packages/transformers/image_utils.py in infer_channel_dimension_format(image, num_channels) 198 first_dim, last_dim = 1, 3 199 else: --> 200 raise ValueError(f"Unsupported number of image dimensions: {image.ndim}") 201 202 if image.shape[first_dim] in num_channels:

ValueError: Unsupported number of image dimensions: 2

TinSn50 avatar Apr 18 '24 19:04 TinSn50