 It seems we cannot use encode_image in DataParallel