aisynth / diffmoog

MIT License
92 stars 3 forks source link

RuntimeError: The size of tensor a (0) must match the size of tensor b (64000) at non-singleton dimension 1 #3

Open turian opened 3 months ago

turian commented 3 months ago

create_dataset.py is failing, even with the defaults. Why?

(env) ubuntu@150-136-146-150:~/diffmoog$ PYTHONPATH=src python3 src/dataset/create_data.py -s train --size 10000 -n OSC_FILTER_SHAPER -g 0
using device:  NVIDIA A100-SXM4-40GB
Creating dataset
 Size = 10000
 Type = train

Missing amp param in Oscillator module lfo_sine. Assuming fixed amp. Please check Synth structure if this is unexpected.
Traceback (most recent call last):
  File "/home/ubuntu/diffmoog/src/dataset/create_data.py", line 200, in <module>
    create_dataset(chain=args.chain, output_dir=output_dir, split=args.split, size=args.size,
  File "/home/ubuntu/diffmoog/src/dataset/create_data.py", line 67, in create_dataset
    synth_obj.generate_signal(signal_duration=signal_duration, batch_size=batch_size)
  File "/home/ubuntu/diffmoog/src/synth/synth_architecture.py", line 146, in generate_signal
    cell.generate_signal(audio_inputs, control_input, cell.parameters, self.sample_rate,
  File "/home/ubuntu/diffmoog/src/synth/synth_architecture.py", line 90, in generate_signal
    signal = self.module.process_sound(input_signal, modulator_signal, params, sample_rate, signal_duration,
  File "/home/ubuntu/diffmoog/src/synth/synth_modules.py", line 196, in process_sound
    wave_tensors = self._generate_wave_tensors(t, amp, freq, phase_mod=phase, sample_rate=sample_rate,
  File "/home/ubuntu/diffmoog/src/synth/synth_modules.py", line 215, in _generate_wave_tensors
    sine_wave = amp * torch.sin(TWO_PI * freq * t + phase_mod)
RuntimeError: The size of tensor a (0) must match the size of tensor b (64000) at non-singleton dimension 1
noyuzrad commented 2 months ago

Hi @turian I am happy for your interest. Did you try debug it? The create_dataset.py script is pretty straight forward. A good chance is that the chain OSC_FILTER_SHAPER is not stable. Many chains were created or used throughout the development process, and were not extensivley checked. I want to check it out for you but unfortunately I am always very busy and the code is not maintained regularly.