我有一个生成器函数,可以生成以下元组:yield (transformed_input_array, set_y)
Transformed_input_array是具有以下形状的 ndarray 列表:(1024, 104), (1024, 142), (1024, 1), (1024, 1), (1024, 1), (1024, 1), (1024, 140) 和以下类型:tf.float64、tf.float64、tf.int8、tf.int16、tf.int8、tf.int8、tf.float64 set_y是形状为1024、类型为int64的ndarray
我用 tf.data.Dataset.from_generator 函数包装了生成器,代码如下:
dataset = tf.data.Dataset.from_generator(
generator,
# output_signature=(
# tf.TensorSpec(shape=(), dtype=(tf.float64, tf.float64, tf.int8, tf.int16, tf.int8, tf.int8, tf.float64)),
# tf.TensorSpec(shape=1024, dtype=tf.int64))
output_types=(tf.float64, tf.float64, tf.int8, tf.int16, tf.int8, tf.int8, tf.float64, tf.int64),
output_shapes=((1024, 104), (1024, 142), (1024, 1), (1024, 1), (1024, 1), (1024, 1), (1024, 140), 1024)
)
Run Code Online (Sandbox Code Playgroud)
但是当我运行训练时,出现以下错误:
ValueError: 数据的格式预计为
x,(x,) …
我在运行google-cloud-sdk的install.bat(或通过'bash'hell的install.sh)时收到此错误消息.Python是版本3.6.
有什么建议?