Traceback (most recent call last):
File "main.py", line 228, in
model = create_model(sess, args, vocab)
File "main.py", line 192, in create_model
model = Model(args, vocab)
File "main.py", line 107, in init
cell_g, soft_func, scope='generator')
File "/home/projects/TST/text-style-transfer-chinese/code/nn.py", line 107, in rnn_decode
output, h = cell(inp, h)
File "/home/anaconda3/envs/qg/lib/python3.7/site-packages/tensorflow/python/ops/rnn_cell_impl.py", line 1159, in call
inputs, state, cell_call_fn=self.cell.call, scope=scope)
File "/home/anaconda3/envs/qg/lib/python3.7/site-packages/tensorflow/python/ops/rnn_cell_impl.py", line 1436, in _call_wrapped_cell
output, new_state = cell_call_fn(inputs, state, kwargs)
File "/home/anaconda3/envs/qg/lib/python3.7/site-packages/tensorflow/python/ops/rnn_cell_impl.py", line 385, in call
self, inputs, state, scope=scope, *args, *kwargs)
File "/home/anaconda3/envs/qg/lib/python3.7/site-packages/tensorflow/python/layers/base.py", line 537, in call
outputs = super(Layer, self).call(inputs, args, kwargs)
File "/home/anaconda3/envs/qg/lib/python3.7/site-packages/tensorflow/python/keras/engine/base_layer.py", line 586, in call
self.name)
File "/home/anaconda3/envs/qg/lib/python3.7/site-packages/tensorflow/python/keras/engine/input_spec.py", line 111, in assert_input_compatibility
layer_name + ' is incompatible with the layer: '
ValueError: Input 0 of layer gru_cell_2 is incompatible with the layer: its rank is undefined, but the layer requires a defined rank.
使用您提供的vocab文件,报错, self.size, self.word2id, self.id2word = pickle.load(f) _pickle.UnpicklingError: invalid load key, '['.