llSourcell / How-to-Generate-Music-Demo

This is the code for "How to Generate Music - Intro to Deep Learning #9' by Siraj Raval on YouTube
Apache License 2.0
83 stars 61 forks source link

NameError: name 'xrange' is not defined #12

Open BigZeroKim opened 5 years ago

BigZeroKim commented 5 years ago

Hello, when generator.py is run i get the following error:

Traceback (most recent call last): File "generator.py", line 193, in main(sys.argv) File "generator.py", line 188, in main generate(data_fn, out_fn, N_epochs) File "generator.py", line 107, in generate chords, abstract_grammars = get_musical_data(data_fn) File "C:\Users\kem63\Documents\Workspace\deepjazz-master\preprocess.py", line 130, in get_musical_data measures, chords = parse_midi(data_fn) File "C:\Users\kem63\Documents\Workspace\deepjazz-master\preprocess.py", line 51, in parse_midi for i in xrange(len(comp_stream)): NameError: name 'xrange' is not defined

I am on Windows 10 Python 3.6

TVI-BIZ commented 5 years ago

change xrange to range xrange - Python 2 range - Python 3