deepsound-project / samplernn-pytorch

PyTorch implementation of SampleRNN: An Unconditional End-to-End Neural Audio Generation Model
MIT License
288 stars 75 forks source link

ZeroDivisionError: division by zero #10

Closed turian closed 6 years ago

turian commented 6 years ago

piano is too big for my GPU, I think:

RuntimeError: cuda runtime error (2) : out of memory at /opt/conda/conda-bld/pytorch_1512387374934/work/torch/lib/THC/generic/THCStorage.cu:58

So I create smallpiano only with ?.wav and ??.wav. However, when I run on it, I get the following:

~/samplernn-pytorch$ python train.py --exp TEST --frame_sizes 16 4 --n_rnn 2 --dataset smallpiano
Traceback (most recent call last):
  File "train.py", line 360, in <module>
    main(**vars(parser.parse_args()))
  File "train.py", line 258, in main
    trainer.run(params['epoch_limit'])
  File "/home/ubuntu/samplernn-pytorch/trainer/__init__.py", line 57, in run
    self.call_plugins('epoch', self.epochs)
  File "/home/ubuntu/samplernn-pytorch/trainer/__init__.py", line 44, in call_plugins
    getattr(plugin, queue_name)(*args)
  File "/home/ubuntu/anaconda3/envs/pytorch_p36/lib/python3.6/site-packages/torch/utils/trainer/plugins/monitor.py", line 56, in epoch
    stats['epoch_mean'] = epoch_stats[0] / epoch_stats[1]
ZeroDivisionError: division by zero

How do I debug this?

comeweber commented 6 years ago

This is a common error. Your batch size is greater than the number of available training files. Try a lower batch size.