Open jeremybmerrill opened 5 years ago
Entirely possible something changed on the Keras side (I haven't tested much with context workflows).
Looking into it.
any progress?
I get the same error. What version of Keras does it work on? I may just downgrade it.
I'm getting the same error.
Same error, bails out at the end:
Traceback (most recent call last):
File "tweet_generator.py", line 70, in <module>
batch_size=cfg['batch_size'])
File "/usr/local/lib/python3.7/site-packages/textgenrnn/textgenrnn.py", line 230, in train_on_texts
outputs=self.model.output[1])
File "/usr/local/lib/python3.7/site-packages/keras/legacy/interfaces.py", line 91, in wrapper
return func(*args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/keras/engine/network.py", line 93, in __init__
self._init_graph_network(*args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/keras/engine/network.py", line 159, in _init_graph_network
' (missing previous layer metadata).')
ValueError: Input tensors to a Model must come from `keras.layers.Input`. Received: Tensor("strided_slice:0", shape=(40,), dtype=float32) (missing previous layer metadata).
I'm still having the same issue. Has anyone tried downgrading Keras?
I'm still having the same issue. Has anyone tried downgrading Keras?
I tried to use it with lower version keras (think it was 2.2.x
maybe?) but then I got other issues like #41
now with eras 2.4.3
I got the same problem the op has mentioned (though I used minimaxir/tweet-generator)):
2765/2765 [==============================] - 1250s 452ms/step - loss: 1.3567
Traceback (most recent call last):
File "tweet_generator.py", line 70, in <module>
batch_size=cfg['batch_size'])
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/textgenrnn/textgenrnn.py", line 278, in train_on_texts
outputs=self.model.output[1])
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorflow/python/keras/engine/training.py", line 242, in __new__
return functional.Functional(*args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorflow/python/training/tracking/base.py", line 457, in _method_wrapper
result = method(self, *args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorflow/python/keras/engine/functional.py", line 115, in __init__
self._init_graph_network(inputs, outputs)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorflow/python/training/tracking/base.py", line 457, in _method_wrapper
result = method(self, *args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorflow/python/keras/engine/functional.py", line 144, in _init_graph_network
self._validate_graph_inputs_and_outputs()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorflow/python/keras/engine/functional.py", line 639, in _validate_graph_inputs_and_outputs
' (missing previous layer metadata).')
ValueError: Input tensors to a Functional must come from `tf.keras.Input`. Received: Tensor("strided_slice:0", shape=(40,), dtype=float32) (missing previous layer metadata).
any ideas how to resolve it and save the model?
Hi! This is a great library, thanks for making and maintaining it. It's fun to play with and the code is easy to follow. :)
I'm trying to train a model with context labels, using a Colab notebook (and locally). Once the training finishes, at https://github.com/minimaxir/textgenrnn/blob/master/textgenrnn/textgenrnn.py#L225-L227, there's an error:
This error also occurs in a colab version of the context iPython notebook in the docs folder here in this repo. I wonder if an API changed between this summer and the present day?
I'm not enough of a Keras expert to know what it should be. (i.e. there's no error if you remove the indexes on those lines, but I'm not sure if that's doing the semantically "right" thing.)