Open ytliang97 opened 4 years ago
Hi, first thanks for getting this done.
Recently I encountered following problem when I try to run evaluate.py:
evaluate.py
I've noticed that the preprocessing codes in train.py use tf.reshape()before decoding images \: use tf.reshape() can convert image from grayscale to rgb. https://github.com/rishizek/tensorflow-deeplab-v3/blob/a5d7ff2a14ebafb8a9b783271e4add82488528d3/train.py#L140-L141 https://github.com/rishizek/tensorflow-deeplab-v3/blob/a5d7ff2a14ebafb8a9b783271e4add82488528d3/train.py#L145-L146
train.py
tf.reshape()
but in evaluate.py, the preprocessing codes didn't use tf.reshape() \: https://github.com/rishizek/tensorflow-deeplab-v3/blob/a5d7ff2a14ebafb8a9b783271e4add82488528d3/utils/preprocessing.py#L233 https://github.com/rishizek/tensorflow-deeplab-v3/blob/a5d7ff2a14ebafb8a9b783271e4add82488528d3/utils/preprocessing.py#L243
This will raise error if there is a grayscale image in dataset. So I edit code like this:
image = tf.image.decode_image( tf.reshape(image_string, shape=[]), 3 ) label = tf.image.decode_image( tf.reshape(label_string, shape=[]), 1 )
It works!
Hi, first thanks for getting this done.
Recently I encountered following problem when I try to run
evaluate.py
:tensorflow.python.framework.errors_impl.InvalidArgumentError: Number of ways to split should evenly divide the split dimension, but got split_dim 2 (size = 1) and num_split 3
I've noticed that the preprocessing codes in
train.py
usetf.reshape()
before decoding images \: usetf.reshape()
can convert image from grayscale to rgb. https://github.com/rishizek/tensorflow-deeplab-v3/blob/a5d7ff2a14ebafb8a9b783271e4add82488528d3/train.py#L140-L141 https://github.com/rishizek/tensorflow-deeplab-v3/blob/a5d7ff2a14ebafb8a9b783271e4add82488528d3/train.py#L145-L146but in
evaluate.py
, the preprocessing codes didn't usetf.reshape()
\: https://github.com/rishizek/tensorflow-deeplab-v3/blob/a5d7ff2a14ebafb8a9b783271e4add82488528d3/utils/preprocessing.py#L233 https://github.com/rishizek/tensorflow-deeplab-v3/blob/a5d7ff2a14ebafb8a9b783271e4add82488528d3/utils/preprocessing.py#L243This will raise error if there is a grayscale image in dataset. So I edit code like this:
It works!