expanding dimension to solve the dimension incompatibility#86
Open
TinSn50 wants to merge 1 commit intobnsreenu:masterfrom
Open
expanding dimension to solve the dimension incompatibility#86TinSn50 wants to merge 1 commit intobnsreenu:masterfrom
TinSn50 wants to merge 1 commit intobnsreenu:masterfrom
Conversation
Solving value error in code block 55:
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-55-9020ca8664fe> in <cell line: 25>()
23 #inputs = processor(single_patch, return_tensors="pt")
24 #Now try with bounding boxes. Remember to uncomment.
---> 25 inputs = processor(single_patch, input_points=input_points, return_tensors="pt")
26
27 # Move the input tensor to the GPU if it's not already there
5 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
|
pip install transformers==4.36.2 可以解决这个问题 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Solving value error in code block 55:
ValueError Traceback (most recent call last)
in <cell line: 25>()
23 #inputs = processor(single_patch, return_tensors="pt")
24 #Now try with bounding boxes. Remember to uncomment.
---> 25 inputs = processor(single_patch, input_points=input_points, return_tensors="pt")
26
27 # Move the input tensor to the GPU if it's not already there
5 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