解决ValueError: (‘Unrecognized keyword arguments:’, dict_keys([‘ragged’]))
ValueError: (‘Unrecognized keyword arguments:’, dict_keys([‘ragged’]))
这个是因为老的k.Input不支持ragged参数,
找到报错最后一行的文件,/usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/engine/input_layer.py,修改如下:
def __init__(self,
input_shape=None,
batch_size=None,
dtype=None,
input_tensor=None,
sparse=False,
name=None,
**kwargs):
if 'batch_input_shape' in kwargs:
batch_input_shape = kwargs.pop('batch_input_shape')
if input_shape and batch_input_shape:
raise ValueError('Only provide the input_shape OR '
'batch_input_shape argument to '
'InputLayer, not both at the same time.')
batch_size = batch_input_shape[0]
input_shape = batch_input_shape[1:]
# NOTE 注释这里:
# if kwargs:
# raise ValueError('Unrecognized keyword arguments:', kwargs.keys())