当我遇到以下错误时,我试图通过 4 个补丁拆分我的图像:
UnimplementedError: Only support ksizes across space
iterator = tf.compat.v1.data.make_one_shot_iterator(parsed_dataset)
image,label = iterator.get_next()
image_height = image.shape[0]
image_width = image.shape[1]
# Since the expected type is (batch,height,width,channels), i have tryied to expand my image that have
# dimensions: (800,344,3) to (1,800,344,3) but didn't solved the error.
#image = tf.expand_dims(image ,0)
images = list(image)
extracted_patches = tf.image.extract_patches(images=images,
sizes=[1,int(0.25*image_height),int(0.25*image_width),3],
strides=[1,int(0.25*image_height),int(0.25*image_width),3],
rates=[1,1,1,1],
padding="SAME")
追溯:
---------------------------------------------------------------------------
UnimplementedError Traceback (most recent call last)
<ipython-input-64-23c2aff4c306> in <module>()
17 strides=[1,int(0.25*image_height),int(0.25*image_width),3],
18 rates=[1,1,1,1],
---> 19 padding="SAME")
20
21
/Users/lucianoaraujo/anaconda2/lib/python2.7/site-packages/tensorflow_core/python/ops/array_ops.pyc in extract_image_patches_v2(images, sizes, strides, rates, padding, name)
4657 """
4658 return gen_array_ops.extract_image_patches(images, sizes, strides, rates,
-> 4659 padding, name)
4660
4661
慕码人2483693
相关分类