-
Notifications
You must be signed in to change notification settings - Fork 344
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
package's version problem #3
Comments
您好,定义模型都是成功的,就是开始训练就不行了 不知道为什么 我是用的自己的数据 只有几百个 分三类
|
额,这是我拉的别人的包,你找找官方包
发自我的iPhone
…------------------ Original ------------------
From: soda ***@***.***>
Date: Sat,May 7,2022 7:17 PM
To: tongzm/ml-python ***@***.***>
Cc: Subscribed ***@***.***>
Subject: Re: [tongzm/ml-python] package's version problem (#3)
您好,定义模型都是成功的,就是开始训练就不行了 不知道为什么 我是用的自己的数据 只有几百个 分三类
报错是这样的:
Epoch 1/5
Traceback (most recent call last):
File "/Users/vesperli/PycharmProjects/Han_2/classifi_keyword_to_caseitem.py", line 119, in
history = model.fit(X_train, Y_train, epochs=epochs, batch_size=batch_size,validation_split=0.1,callbacks=[EarlyStopping(monitor='val_loss', patience=3, min_delta=0.0001)])
File "/Users/vesperli/opt/anaconda3/envs/Han_2/lib/python3.8/site-packages/keras/utils/traceback_utils.py", line 67, in error_handler
raise e.with_traceback(filtered_tb) from None
File "/Users/vesperli/opt/anaconda3/envs/Han_2/lib/python3.8/site-packages/tensorflow/python/framework/func_graph.py", line 1147, in autograph_handler
raise e.ag_error_metadata.to_exception(e)
ValueError: in user code:
File "/Users/vesperli/opt/anaconda3/envs/Han_2/lib/python3.8/site-packages/keras/engine/training.py", line 1021, in train_function * return step_function(self, iterator) File "/Users/vesperli/opt/anaconda3/envs/Han_2/lib/python3.8/site-packages/keras/engine/training.py", line 1010, in step_function ** outputs = model.distribute_strategy.run(run_step, args=(data,)) File "/Users/vesperli/opt/anaconda3/envs/Han_2/lib/python3.8/site-packages/keras/engine/training.py", line 1000, in run_step ** outputs = model.train_step(data) File "/Users/vesperli/opt/anaconda3/envs/Han_2/lib/python3.8/site-packages/keras/engine/training.py", line 860, in train_step loss = self.compute_loss(x, y, y_pred, sample_weight) File "/Users/vesperli/opt/anaconda3/envs/Han_2/lib/python3.8/site-packages/keras/engine/training.py", line 918, in compute_loss return self.compiled_loss( File "/Users/vesperli/opt/anaconda3/envs/Han_2/lib/python3.8/site-packages/keras/engine/compile_utils.py", line 201, in __call__ loss_value = loss_obj(y_t, y_p, sample_weight=sw) File "/Users/vesperli/opt/anaconda3/envs/Han_2/lib/python3.8/site-packages/keras/losses.py", line 141, in __call__ losses = call_fn(y_true, y_pred) File "/Users/vesperli/opt/anaconda3/envs/Han_2/lib/python3.8/site-packages/keras/losses.py", line 245, in call ** return ag_fn(y_true, y_pred, **self._fn_kwargs) File "/Users/vesperli/opt/anaconda3/envs/Han_2/lib/python3.8/site-packages/keras/losses.py", line 1789, in categorical_crossentropy return backend.categorical_crossentropy( File "/Users/vesperli/opt/anaconda3/envs/Han_2/lib/python3.8/site-packages/keras/backend.py", line 5083, in categorical_crossentropy target.shape.assert_is_compatible_with(output.shape) ValueError: Shapes (None, 3) and (None, 10) are incompatible
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
please tell us which version you are use of keras and tensorflow, thanks.
The text was updated successfully, but these errors were encountered: