language-identification icon indicating copy to clipboard operation
language-identification copied to clipboard

Cannot train with batch size > 1

Open prothej227 opened this issue 2 years ago • 2 comments

image

Hi! I am having this issue when training with batch size > 1:

tensorflow.python.framework.errors_impl.InvalidArgumentError: 2 root error(s) found.
  (0) Invalid argument:  Cannot add tensor to the batch: number of elements does not match. Shapes are: [tensor]: [119130,1], [batch]: [80000,1]
	 [[node IteratorGetNext (defined at train.py:117) ]]
  (1) Invalid argument:  Cannot add tensor to the batch: number of elements does not match. Shapes are: [tensor]: [119130,1], [batch]: [80000,1]
	 [[node IteratorGetNext (defined at train.py:117) ]]
	 [[Shape/_4]]
0 successful operations.
0 derived errors ignored. [Op:__inference_train_function_14011]

Function call stack:
train_function -> train_function

prothej227 avatar Aug 15 '22 05:08 prothej227

it looks like your samples have a different size than I expect. The model expects the sample to be 5sec @16kHz which is 80000 values. Your input has 119130...

bytosaur avatar Aug 22 '22 14:08 bytosaur

I suggest looking into tools to prepare the samples, ie. resample, change bit rate, trim to length, etc. I suggest checking out sox, a command line tool.

enohp ym morf tnes

Dan Wilcox danomatika.com robotcowboy.com

On Aug 22, 2022, at 4:47 PM, paul @.***> wrote:

 it looks like your samples have a different size than I expect. The model expects the sample to be 5sec @16kHz which is 80000 values. Your input has 119130...

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.

danomatika avatar Aug 22 '22 16:08 danomatika