Skip to content

Sampler: IndexError out of bounds #98

@primus852

Description

@primus852
  • CTGAN version: 0.2.2
  • Python version: 3.7 (Anaconda)
  • Operating System: Windows 10

Description

I tried to load a sample tsv file (instead of the adult demo). Unfortunately it crashes with various variations of the file (always the same structure).

What I Did

data = pd.read_csv('https://github.com/DCMLab/ABC/raw/master/data/tsv/op.%20127%20No.%2012/op127_no12_mov1.tsv', delimiter='\t')
    # data = pd.read_csv('https://github.com/DCMLab/ABC/raw/master/data/tsv/op.%2018%20No.%203/op18_no3_mov3.tsv', delimiter='\t')
    # data = pd.read_csv('https://github.com/DCMLab/ABC/raw/master/data/tsv/op.%2059%20No.%209/op59_no9_mov3.tsv', delimiter='\t')

    discrete_columns = [
        'chord',
        'altchord',
        'timesig',
        'global_key',
        'local_key',
        'pedal',
        'numeral',
        'form',
        'relativeroot'
    ]

    ctgan = CTGANSynthesizer()
    ctgan.fit(data, data.columns, epochs=5)

    samples = ctgan.sample(1000)
    print(samples)

Traceback

Traceback (most recent call last):
  File "D:/Projects/Master/pythonProject/main.py", line 30, in <module>
    ctgan.fit(data, data.columns, epochs=5)
  File "C:\Users\XXX\anaconda3\lib\site-packages\ctgan\synthesizer.py", line 157, in fit
    data_sampler = Sampler(train_data, self.transformer.output_info)
  File "C:\Users\XXX\anaconda3\lib\site-packages\ctgan\sampler.py", line 28, in __init__
    tmp.append(np.nonzero(data[:, st + j])[0])
IndexError: index 1086 is out of bounds for axis 1 with size 1086

index varies from file to file

Metadata

Metadata

Assignees

Labels

questionGeneral question about the software

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions