Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] when fitting model (page 303) #606

Open
Cunoo opened this issue Feb 21, 2023 · 0 comments
Open

[BUG] when fitting model (page 303) #606

Cunoo opened this issue Feb 21, 2023 · 0 comments

Comments

@Cunoo
Copy link

Cunoo commented Feb 21, 2023

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..error_handler(*args, **kwargs)
65 except Exception as e: # pylint: disable=broad-except
66 filtered_tb = _process_traceback_frames(e.traceback)
---> 67 raise e.with_traceback(filtered_tb) from None
68 finally:
69 del filtered_tb

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..autograph_handler(*args, **kwargs)
1145 except Exception as e: # pylint:disable=broad-except
1146 if hasattr(e, "ag_error_metadata"):
-> 1147 raise e.ag_error_metadata.to_exception(e)
1148 else:
1149 raise

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
image

Versions (please complete the following information):

  • OS: [win10]
  • Python: [Python 3.10.10]
  • TensorFlow: [2.8.1]
@Cunoo Cunoo changed the title [BUG] [BUG] when fitting model Feb 21, 2023
@Cunoo Cunoo changed the title [BUG] when fitting model [BUG] when fitting model (page 303) Feb 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant