ayoolaolafenwa / PixelLib

Visit PixelLib's official documentation https://pixellib.readthedocs.io/en/latest/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ValueError: cannot reshape array of size 339 into shape (256,3)

Chantip-P opened this issue · comments

i got an error while following the custom train tutorial. is there anyway to fix this?
ValueError Traceback (most recent call last)
in ()
8 train_maskrcnn.load_pretrained_model("mask_rcnn_coco.h5")
9 train_maskrcnn.load_dataset("Nature")
---> 10 train_maskrcnn.train_model(num_epochs = 300, augmentation=True, path_trained_models = "mask_rcnn_models")

518 # get palette as an array with R, G, B columns
--> 519 palette = np.asarray(pil_image.getpalette()).reshape((256, 3))
520 # Not all palette colors are used; unused colors have junk values.
521 start, stop = pil_image.getextrema()

ValueError: cannot reshape array of size 339 into shape (256,3)

Hi I am having the same problem. Did you figure out the solution or have any ideas? Mine is cannot reshape array of size 390 into shape (256,3) though. When I tried adding a validation set and moved some of the training set into it, however, it was cannot reshape array of size 339 into shape (256,3).