在tensorflow2下使用TPU训练时
...
tf.pad(inputs, [[0, 0], [10, 10], [10, 10], [0, 0]], mode='reflect')
...
batch_size = 1 * tpu_strategy.num_replicas_in_sync
data_set = tf.data.Dataset.from_tensor_slices(X_data) # X_data is a numpy Array
data_set.batch(batch_size)
...
model.fit(data_set, epochs=1)
出现以下错误:
UnimplementedError: {
{function_node __inference_train_function_18379}} Compilation failure: Dynamic dimension propagation on reversed dimension is not supported %reverse.1029 = f32[<=2,276,276,3]{3,2,1,0} reverse(f32[<=2,276,276,3]{3,2,1,0} %concatenate.1028), dimensions={0}, metadata={op_type="MirrorPad" op_name="style_transfer_net/tf_op_layer_MirrorPad/MirrorPad"}
TPU compilation failed
[[{
{node tpu_compile_succeeded_assert/_9843984394415337403/_4}}]]