Closed JeremyBYU closed 5 years ago
I could not reproduce the above error.
Do you use image what it's in examples/
?
(If there is any modification in the ipynb file, please show me the diff.)
Can you show me the result performing pip freeze
?
Okay, it looks like it was in image issue. I was using my own image, but it was in a .png format (it also was already 224X224). I saved the image as a JPG and now there are no errors.
Here are the example images of png and jpg. First throws error, second doesn't seem to. https://ibb.co/ixXpjp https://ibb.co/iEVLqU
Thanks!
Aren't you directly using Pillow API?
Your image file is 'P' mode file (See details: https://pillow.readthedocs.io/en/3.1.x/handbook/concepts.html#concept-modes). So, you have to use Keras API or to convert mode to 'RGB'.
Using Keras API
from keras.preprocessing import image
img = image.load_img('/your/image/file/path')
Using convert()
from PIL import Image
img = Image.open('/your/image/file/path')
img = img.convert('RGB')
I believe this issue is resolved. I close this but please reopen this issue if I have mistaken.
Hello I also have a similar issue, i am using my own image and i get the error below: "tensorflow.python.framework.errors_impl.InvalidArgumentError: The first dimension of paddings must be the rank of inputs[4,2] [1,512,512] [[{{node zero_padding2d_1_1/Pad}}]]"
I am giving the same size with which i trained the model for my image.
[ X] Check that you are up-to-date with the master branch of keras-vis. You can update with: pip install git+git://github.com/raghakot/keras-vis.git --upgrade --no-deps
[X ] If running on TensorFlow, check that you are up-to-date with the latest version. The installation instructions can be found here.
[ X] Provide a link to a GitHub Gist of a Python script that can reproduce your issue (or just copy the script here if it is short).
I have the latest keras, tensorflow 1.10, and the latest keras-vis cloned from master. I am running the example code for found here: https://github.com/raghakot/keras-vis/blob/master/examples/resnet/attention.ipynb
This code triggers the error:
This is the error that I receive: