qiuqiangkong / sampleRNN_acoustic_scene_generation

Other
13 stars 3 forks source link

Change number of classes #7

Open ghost opened 5 years ago

ghost commented 5 years ago

Hello, I've managed to do datasets that look closely like yours but instead of having 15 sid I have only 2. So, I modified everything that was "15" to "2" in two_tier_spkdird.py. It bugs though.

Traceback (most recent call last):
  File "two_tier_spkdird.py", line 621, in <module>
    cost, h0 = train_fn(seqs, sids, h0, reset, mask)
  File "/home/vincent/.local/lib/python2.7/site-packages/theano/compile/function_module.py", line 917, in __call__
    storage_map=getattr(self.fn, 'storage_map', None))
  File "/home/vincent/.local/lib/python2.7/site-packages/theano/gof/link.py", line 325, in raise_with_op
    reraise(exc_type, exc_value, exc_trace)
  File "/home/vincent/.local/lib/python2.7/site-packages/theano/compile/function_module.py", line 903, in __call__
    self.fn() if output_subset is None else\
IndexError: Index out of bounds.
Apply node that caused the error: GpuAdvancedSubtensor1(SampleLevel.Embedding, GpuContiguous.0)
Toposort index: 298
Inputs types: [GpuArrayType<None>(float32, matrix), GpuArrayType<None>(int64, vector)]
Inputs shapes: [(256, 256), (2097152,)]
Inputs strides: [(1024, 4), (8,)]
Inputs values: ['not shown', 'not shown']
Inputs type_num: [11, 7]
Outputs clients: [[GpuReshape{2}(GpuAdvancedSubtensor1.0, TensorConstant{[  -1 4096]})]]

Backtrace when the node is created(use Theano flag traceback.limit=N to make it longer):
  File "two_tier_spkdird.py", line 384, in <module>
    prev_samples,spkids,
  File "two_tier_spkdird.py", line 306, in sample_level_predictor
    prev_samples)
  File "/home/vincent/sampleRNN_acoustic_scene_generation/lib/ops.py", line 268, in Embedding
    return vectors[indices.flatten()].reshape(output_shape)
  File "/home/vincent/.local/lib/python2.7/site-packages/theano/gpuarray/type.py", line 675, in __getitem__
    return _operators.__getitem__(self, *args)
  File "two_tier_spkdird.py", line 384, in <module>
    prev_samples,spkids,
  File "two_tier_spkdird.py", line 306, in sample_level_predictor
    prev_samples)
  File "/home/vincent/sampleRNN_acoustic_scene_generation/lib/ops.py", line 268, in Embedding
    return vectors[indices.flatten()].reshape(output_shape)
  File "/home/vincent/.local/lib/python2.7/site-packages/theano/gpuarray/type.py", line 675, in __getitem__
    return _operators.__getitem__(self, *args)

What do I have to modify to change the number of classes ? Thank you