我明白了
ValueError: Python inputs incompatible with input_signature:
当我这样做时:
image_np = np.asarray(np.array(Image.open(image_path)))
input_tensor = tf.convert_to_tensor(image_np)
input_tensor = input_tensor[tf.newaxis, ...]
detections = detect_fn(input_tensor)
问题恰恰发生在这一行:
detections = detect_fn(input_tensor)
我做错了什么?这个错误意味着什么
控制台日志
ValueError: Python inputs incompatible with input_signature:
inputs: (
tf.Tensor(
[[[[255 255 255 255]
[255 255 255 255]
[255 255 255 255]
...
[255 255 255 255]
[255 255 255 255]
[255 255 255 255]]
[[254 254 254 255]
[255 255 255 255]
[255 255 255 255]
...
[255 255 255 255]
[255 255 255 255]
[255 255 255 255]]
[[254 254 254 255]
[254 254 255 255]
[255 255 255 255]
...
[255 255 255 255]
[255 255 255 255]
[255 255 255 255]]
...
[[ 37 37 37 255]
[ 37 37 37 255]
[ 39 39 39 255]
...
[ 32 32 32 255]
[ 33 33 33 255]
[ 31 31 31 255]]
[[ 37 37 37 255]
[ 38 38 38 255]
[ 36 36 36 255]
...
[ 33 33 33 255]
[ 31 31 31 255]
[ 32 32 32 255]]
[[ 38 38 38 255]
[ 37 37 37 255]
[ 38 38 38 255]
...
[ 32 32 32 255]
[ 31 31 31 255]
[ 32 32 32 255]]]], shape=(1, 1080, 1915, 4), dtype=uint8))
input_signature: (
TensorSpec(shape=(1, None, None, 3), dtype=tf.uint8, name='input_tensor'))
您正在尝试使用3通道输入将4通道图像馈送到NN。删除最后一个通道:
相关问题 更多 >
编程相关推荐