-
Notifications
You must be signed in to change notification settings - Fork 223
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
Error: all input arrays must have the same shape #39
Comments
could you elaborate it by copy-paste your code here, thanks |
based on the part of your code, I'm guessing your input images are not in the same shape, instead they are arbitrary size images. And if I'm correct about it, you need to add a preprocessing step to resize the images. You can do it by: d = Document()
d.set_image_blob_shape(shape=(128, 128)) If you are working with DocumentArray as in README, then from docarray import Document
def preproc(d: Document):
return (d.load_uri_to_image_blob() # load
.set_image_blob_shape(shape=(128, 128)) # <----- ADD to unify the shape, 128 is just an example, use whatever makes sense to you
.set_image_blob_normalization() # normalize color
.set_image_blob_channel_axis(-1, 0)) # switch color axis for the pytorch model later |
Thank you! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Unfortunately, when following your steps, i get the error: "all input arrays must have the same shape"
The text was updated successfully, but these errors were encountered: