EcoDynIZW / imageseg

R package for deep learning image segmentation
Other
19 stars 2 forks source link

Number of items to replace is not a multiple of replacement length #2

Closed williamhoole closed 11 months ago

williamhoole commented 1 year ago

I get the following error when converting images to Keras input:

Error in array_out[i, , , ] <- images_proc[[i]] : number of items to replace is not a multiple of replacement length

The images are PNG format and are RGB.

how do I fix this ?

jniedballa commented 1 year ago

Can you provide a reproducible example please, and describe the situation under which the error occurs? That would also help testing your PR. Thank you!

williamhoole commented 1 year ago

Hi,

i have imported 1500 PNG images using imageseg:

train <- loadImages(imageDir = train_dir)

the images are RGB and would like to use all 3 color channels for training but when I run this line, I get the error mentioned above. x_train <- imagesToKerasInput(train, type = "image", grayscale = FALSE)

but if I change grayscale to TRUE I do not get the error.

jniedballa commented 1 year ago

If you don't mind, can you please share a reproducible example with your png files? I can't tell from the error what the problem is (but as you pointed out probably related to the colorspace), so I'd need to test it to fix. If a small subset of the 1500 png images is enough to demonstrate the error, even better. Feel free to share a link with your data privately to the package maintainer email address. Thank you

jniedballa commented 11 months ago

Closing this for now. Feel free to reopen with a reproducible example.