- darknet转tensorflow模型时,遇到这个问题
- 既然tensorflow没有这个函数,我们就自己实现,把调用的地方改成调用自己的函数
import tensorflow as tf
def LeakyRelu(x, leak=0.2, name="LeakyRelu"):
with tf.variable_scope(name):
f1 = 0.5 * (1 + leak)
f2 = 0.5 * (1 - leak)
return f1 * x + f2 * tf.abs(x)