我有一个用Tensorflow.Keras编写的自定义神经网络,并将硬开关函数作为激活应用(如MobileNetV3论文中所用):

执行情况:
def swish(x):
return x * tf.nn.relu6(x+3) / 6我正在运行量化感知训练,并在最后编写一个原型文件。然后,我使用此代码将其转换为tflite (并最终将其部署到EdgeTPU上):
tflite_convert --output_file test.tflite --graph_def_file=test.pb --inference_type=QUANTIZED_UINT8 --input_arrays=input_1 --output_arrays=conv2d_3/Sigmoid --mean_values=0 --std_dev_values=255 --default_ranges_min=0 --default_ranges_max=6当我没有除以6的时候,当除以6时,我得到了这个错误:
Unimplemented: this graph contains an operator of type Div for which the quantized form is not yet implemented.我正在使用TF 1.14训练和TF 1.15昨晚的构建转换为TFLITE;我正在努力使TF 2.x工作一些奇怪的HDF5不兼容,但如果有人知道如何绕过这个问题。谢谢!
发布于 2020-02-21 10:30:25
由于它是一个常量除法,所以您只需乘以(接近于)逆:
def swish(x):
return x * tf.nn.relu6(x+3) * 0.16666667https://stackoverflow.com/questions/60336568
复制相似问题