赞
踩
首先
import tensorflow as tf
改为
import tensorflow.compat.v1 as tf
tf.disable_eager_execution()
还有一些其他的
如
kernel_initializer = tf.contrib.layers.variance_scaling_initializer()
改为
kernel_initializer = tf.glorot_uniform_initializer()
import tensorflow.contrib.slim as slim
改为
import tf_slim as slim
from tensorflow.contrib.layers.python.layers import initializers
改为
from tf_slim.layers import initializers
from tensorflow.contrib.crf import crf_log_likelihood
from tensorflow.contrib.crf import viterbi_decode
改为
from tensorflow_addons.text.crf import viterbi_decode
from tensorflow_addons.text.crf import crf_log_likelihood
from tensorflow.contrib.compiler import jit
改为
from tensorflow.compiler import jit
参考:
https://zhuanlan.zhihu.com/p/413019685
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。