We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
python3 samples/mlp_learning_an_image_pytorch.py # with default albert.jpg & config.json
give errors:
ValueError: Can't write images with one color channel.
looks the write_image_imageio() under common.py missing handle grayscale image correctly. added as following:
def write_image_imageio(img_file, img, quality): img = (np.clip(img, 0.0, 1.0) * 255.0 + 0.5).astype(np.uint8) # kwargs = {} if os.path.splitext(img_file)[1].lower() in [".jpg", ".jpeg"]: if img.ndim >= 3 and img.shape[2] > 3: img = img[:,:,:3] if img.ndim >= 3 and img.shape[2] == 1: # grayscale img = np.squeeze(img) kwargs["quality"] = quality kwargs["subsampling"] = 0 imageio.imwrite(img_file, img, **kwargs)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
python3 samples/mlp_learning_an_image_pytorch.py # with default albert.jpg & config.json
give errors:
looks the write_image_imageio() under common.py missing handle grayscale image correctly. added as following:
The text was updated successfully, but these errors were encountered: