I suspect your test_image
has an additional alpha channel per pixel, thus it has 4 channels instead of only three.
Try:
test_image = Image.open(test_image_name).convert('RGB')
I suspect your test_image
has an additional alpha channel per pixel, thus it has 4 channels instead of only three.
Try:
test_image = Image.open(test_image_name).convert('RGB')