You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you for all the input.
I have, however, problems to get the tutorial (https://modeldepot.io/hellochick/pspnet) running on my machine. Unfortunately, I'm very new to python.
Minimal example:
import tensorflow as tf
import numpy as np
from scipy import misc
import matplotlib.pyplot as plt
from PIL import Image
from model import PSPNet101, PSPNet50
from tools import *
Thank you for all the input.
I have, however, problems to get the tutorial (https://modeldepot.io/hellochick/pspnet) running on my machine. Unfortunately, I'm very new to python.
Minimal example:
import tensorflow as tf
import numpy as np
from scipy import misc
import matplotlib.pyplot as plt
from PIL import Image
from model import PSPNet101, PSPNet50
from tools import *
image_path = './input/test1.png'
img_np, filename = load_img(image_path)
plt.imshow(img_np)
This leads to an error message:
_img_np, filename = load_img(image_path)
plt.imshow(img_np)
successful load img: ./input/test1.png
Traceback (most recent call last):
File "", line 2, in
plt.imshow(img_np)
File "C:\Anaconda3\lib\site-packages\matplotlib\pyplot.py", line 3080, in imshow
**kwargs)
File "C:\Anaconda3\lib\site-packages\matplotlib_init_.py", line 1710, in inner
return func(ax, *args, **kwargs)
File "C:\Anaconda3\lib\site-packages\matplotlib\axes_axes.py", line 5194, in imshow
im.set_data(X)
File "C:\Anaconda3\lib\site-packages\matplotlib\image.py", line 600, in set_data
raise TypeError("Image data cannot be converted to float")
TypeError: Image data cannot be converted to float_
The problem seems to be that img_np is shapeless:
img_np
Out[3]: <tf.Tensor 'DecodePng:0' shape=(?, ?, 3) dtype=uint8>
This issue is well discussed (tensorflow/tensorflow#9356), but I could not figure out the solution - does anybody has a hint?
I'd like to read in images of different sizes.
All the best,
Pascal
The text was updated successfully, but these errors were encountered: