mdeff / fma

FMA: A Dataset For Music Analysis
https://arxiv.org/abs/1612.01840
MIT License
2.21k stars 432 forks source link

can not run deep learning baseline. #15

Closed YaoStriveCode closed 3 years ago

YaoStriveCode commented 6 years ago

When I run the baseline, I bump into this problems. Can anyone help me with this?

Dimensionality: (59953,)
Epoch 1/2
 1664/19922 [=>............................] - ETA: 2559s - loss: 15.5950 - acc: 0.0325
Process Process-7:
Traceback (most recent call last):
  File "/anaconda3/envs/deeplearning3.5/lib/python3.5/multiprocessing/process.py", line 252, in _bootstrap
    self.run()
  File "/anaconda3/envs/deeplearning3.5/lib/python3.5/multiprocessing/process.py", line 93, in run
    self._target(*self._args, **self._kwargs)
  File "/anaconda3/envs/deeplearning3.5/lib/python3.5/site-packages/keras/engine/training.py", line 429, in data_generator_task
    generator_output = next(self._generator)
  File "/Users/dc/Downloads/fma-rc1/utils.py", line 327, in __next__
    self.X[i] = self.loader.load(get_audio_path(audio_dir, tid))
ValueError: could not broadcast input array from shape (59943) into shape (59953)
 1696/19922 [=>............................] - ETA: 2552s - loss: 15.5954 - acc: 0.0324
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-25-373babcd7ac0> in <module>()
     16 model.compile(optimizer, loss='categorical_crossentropy', metrics=['accuracy'])
     17 
---> 18 model.fit_generator(SampleLoader(train, batch_size=32), train.size, nb_epoch=2, **params)
     19 loss = model.evaluate_generator(SampleLoader(val, batch_size=32), val.size, **params)
     20 loss = model.evaluate_generator(SampleLoader(test, batch_size=32), test.size, **params)

/anaconda3/envs/deeplearning3.5/lib/python3.5/site-packages/keras/models.py in fit_generator(self, generator, samples_per_epoch, nb_epoch, verbose, callbacks, validation_data, nb_val_samples, class_weight, max_q_size, nb_worker, pickle_safe, initial_epoch, **kwargs)
    933                                         nb_worker=nb_worker,
    934                                         pickle_safe=pickle_safe,
--> 935                                         initial_epoch=initial_epoch)
    936 
    937     def evaluate_generator(self, generator, val_samples,

/anaconda3/envs/deeplearning3.5/lib/python3.5/site-packages/keras/engine/training.py in fit_generator(self, generator, samples_per_epoch, nb_epoch, verbose, callbacks, validation_data, nb_val_samples, class_weight, max_q_size, nb_worker, pickle_safe, initial_epoch)
   1530                                          '(x, y, sample_weight) '
   1531                                          'or (x, y). Found: ' +
-> 1532                                          str(generator_output))
   1533                     if len(generator_output) == 2:
   1534                         x, y = generator_output

ValueError: output of generator should be a tuple (x, y, sample_weight) or (x, y). Found: None
mdeff commented 6 years ago

Mmhhh that's strange. Especially as it happens after quite some successful batches. Though I have to admit the deep learning baselines were not fully finished and were left there as is. Please share if anybody encountered this issue or found a solution.

kwontaeheon commented 6 years ago

I'm getting this error too. It looks like shape isn't matched.

harold-xue commented 5 years ago

I get same error. Anyone has some idea?

deepaks857 commented 5 years ago

I'm getting the same error as well.

Hanyman8 commented 4 years ago

Same issue

mdeff commented 4 years ago

Documented as a known issue in #41 and the README.

It probably won't be fixed unless somebody wants to contribute a PR.

JustinKavalan commented 4 years ago

I created a workaround for this error as part of my final project with @arvindkrishna87, however I am unable to test my changes on the current version of master.

I went ahead and created pull request #42, but any help in testing it (e.g. updated version of fma_metadata, testing the fork on your current working environment) would be very much appreciated.

mdeff commented 3 years ago

Fixed thanks to @JustinKavalan :)