Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expand dimension of patched training image #85

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sanjeev4427
Copy link

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

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)
<ipython-input-18-ee9fee6be012> 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant