aa *_* bb 5 artificial-intelligence tensorflow google-colaboratory tpu
当我尝试使用 TPU 在 google colab 上使用我自己的图像训练图像检测器时出现此错误:
来自 /job:worker/replica:0/task:0:编译失败:要求从 hlo %convert.283 = f32[1,80,80,32]{3,2,1,0} 传播动态维度(f32[1,80,80,32]{3,2,1,0} %add.1), 元数据={op_type="FusedBatchNorm" op_name="bn_Conv1_3/FusedBatchNorm"}@{}@0 到 hlo %钳位.288 = f32[1,80,80,32]{3,2,1,0} 钳位(f32[1,80,80,32]{3,2,1,0} %broadcast.286, f32 [1,80,80,32]{3,2,1,0} %convert.283, f32[1,80,80,32]{3,2,1,0} %broadcast.287), 元数据= {op_type="Relu6" op_name="Conv1_relu_3/Relu6"},未实现。TPU 编译失败 [[节点 TPUReplicateMetadata_1(定义于:24)]]
这是代码的链接:
https://drive.google.com/open?id=1mPiod1At85RgNwHx4vYFxH38Ck16Ep1m
你知道发生了什么事吗?
一定不是图片大小的问题,也不是批量大小的问题,我已经看过了。
谢谢。
小智 1
我认为问题出在你的标签上。请尝试以下代码:
y_train = tf.keras.utils.to_categorical(labels, NUM_CLASSES)
y_test = tf.keras.utils.to_categorical(labelstest, NUM_CLASSES)
zeros = tf.zeros([NUM_CLASSES], tf.int32)
y_train = tf.math.add(y_train,zeros)
y_test = tf.math.add(y_train,zeros)
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
819 次 |
| 最近记录: |