最近写代码的时候发生了一件奇怪的错误
NotImplementedError: Cannot convert a symbolic Tensor (bert/encoder/layer_0/attention/self/strided_slice:0) to a numpy array. This error may indicate that you're trying to pass a Tensor to a NumPy call, which is not supported
这里的源代码内容是这样的
sh = self.get_shape_list(from_tensor)
#data = sh[:2]
mask = tf.ones(sh[:2],dtype=tf