【发布时间】:2022-09-05 19:05:49
【问题描述】:
收到此错误。看起来这是由于 train_step_signature 和数据集上的 dtype 不一样?有没有办法将 Prefetch 数据集的格式从 int32 更改为 tf.int64?谢谢
ValueError: Python inputs incompatible with input_signature:
inputs: (
tf.Tensor(
[[ 77 111 110 ... 0 0 0]
[ 83 105 110 ... 0 0 0]
[ 71 97 115 ... 0 0 0]
...
[ 80 114 111 ... 0 0 0]
[ 70 114 97 ... 0 0 0]
[ 65 110 233 ... 0 0 0]], shape=(64, 605), dtype=int32),
tf.Tensor(
[[ 68 101 115 ... 0 0 0]
[ 76 101 32 ... 0 0 0]
[ 76 101 32 ... 0 0 0]
...
[ 68 97 110 ... 0 0 0]
[ 85 110 101 ... 0 0 0]
[ 68 97 110 ... 0 0 0]], shape=(64, 936), dtype=int32))
input_signature: (
TensorSpec(shape=(None, None), dtype=tf.int64, name=None),
TensorSpec(shape=(None, None), dtype=tf.int64, name=None)).
【问题讨论】:
标签: python tensorflow tensorflow-datasets