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

Batch_size error ? #17

Closed
bearlu007 opened this issue Dec 19, 2018 · 6 comments
Closed

Batch_size error ? #17

bearlu007 opened this issue Dec 19, 2018 · 6 comments

Comments

@bearlu007
Copy link

Hi . Thanks for the code first.
When I run the training, I got an issue below. I just follow the simple instructions and did not add extra input. Do you know why this happens ? Thank you very much.

Epoch 1/120
Traceback (most recent call last):
File "./src/train_lpcnet.py", line 150, in
model.fit([in_data, in_exc, features, periods], out_data, batch_size=batch_size, epochs=nb_epochs, validation_split=0.0, callbacks=[checkpoint, lpcnet.Sparsify(2000, 40000, 400, (0.1, 0.1, 0.1))])
File "/usr/local/lib/python3.6/site-packages/keras/engine/training.py", line 1039, in fit
validation_steps=validation_steps)
File "/usr/local/lib/python3.6/site-packages/keras/engine/training_arrays.py", line 199, in fit_loop
outs = f(ins_batch)
File "/usr/local/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py", line 2715, in call
return self._call(inputs)
File "/usr/local/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py", line 2675, in _call
fetched = self._callable_fn(*array_vals)
File "/usr/local/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1382, in call
run_metadata_ptr)
File "/usr/local/lib/python3.6/site-packages/tensorflow/python/framework/errors_impl.py", line 519, in exit
c_api.TF_GetCode(self.status.status))
tensorflow.python.framework.errors_impl.InvalidArgumentError: Incompatible shapes: [153600] vs. [64,2400]
[[Node: metrics_1/sparse_categorical_accuracy/Equal = Equal[T=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:GPU:0"](metrics_1/sparse_categorical_accuracy/Reshape, metrics_1/sparse_categorical_accuracy/Cast)]]
[[Node: loss_1/mul/_237 = _Recvclient_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device_incarnation=1, tensor_name="edge_2235_loss_1/mul", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:CPU:0"]]

@dgromero
Copy link

I also got that error. I removed the "sparse_categorical_accuracy" metric and got it to run. Not sure how to keep the metric and make it work though.

@azraelkuan
Copy link

update your keras

@dgromero
Copy link

I am using the versions below (latest) and still get the error when trying to use the metric. What versions do you use to make it run?

import tensorflow as tf
tf.version
'1.12.0'
import keras
Using TensorFlow backend.
keras.version
'2.2.4'

@dengliqun
Copy link

I also come into this error, and I have updated Keras to the latest but without help. Does anyone has a answer for it? Thanks very much

@luvpine
Copy link

luvpine commented Dec 24, 2018

The lastest keras has an error!
check this : https://github.com/keras-team/keras/pull/11373/files/7f27b67344fd88ae50fc7d661fc69e366590ef04

@dengliqun
Copy link

The lastest keras has an error!
check this : https://github.com/keras-team/keras/pull/11373/files/7f27b67344fd88ae50fc7d661fc69e366590ef04

It works. Thanks~

@jmvalin jmvalin closed this as completed Oct 14, 2021
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

6 participants