handson-ml2
handson-ml2 copied to clipboard
[BUG] when fitting model (page 303)
Thanks for helping us improve this project!
hello
Describe the bug
hello i have problem with evaluating the model (page 303 2nd edition)
when i do history = model.fit(X_train, y_train, epochs=30, validation_data=(X_valid, y_valid))
i got:
`Epoch 1/30 Output exceeds the size limit. Open the full output data in a text editor
ValueError Traceback (most recent call last) Cell In[126], line 1 ----> 1 history = model.fit(X_train, y_train, epochs=30, 2 validation_data=(X_valid, y_valid))
File c:\Users\rain\AppData\Local\Programs\Python\Python310\lib\site-packages\keras\utils\traceback_utils.py:67, in filter_traceback.
File c:\Users\rain\AppData\Local\Programs\Python\Python310\lib\site-packages\tensorflow\python\framework\func_graph.py:1147, in func_graph_from_py_func.
ValueError: in user code:
File "c:\Users\rain\AppData\Local\Programs\Python\Python310\lib\site-packages\keras\engine\training.py", line 1021, in train_function *
return step_function(self, iterator)
File "c:\Users\rain\AppData\Local\Programs\Python\Python310\lib\site-packages\keras\engine\training.py", line 1010, in step_function **
... File "c:\Users\rain\AppData\Local\Programs\Python\Python310\lib\site-packages\keras\backend.py", line 5083, in categorical_crossentropy target.shape.assert_is_compatible_with(output.shape)
ValueError: Shapes (None, 1) and (None, 10) are incompatible`
To Reproduce
Screenshots
Versions (please complete the following information):
- OS: [win10]
- Python: [Python 3.10.10]
- TensorFlow: [2.8.1]