我正在尝试在以下存储库中执行github代码:
https://github.com/shubham3121/music-generation-using-rnn 错误在于以下功能:
def generate():
""" Generate a piano midi file """
#load the notes used to train the model
with open('data/notes','rb') as filepath:
notes = pickle.load(filepath)
# Get all pitch names
pitchnames = sorted(set(item for item in notes))
# Get all pitch names
n_vocab = len(set(notes))
print('Initiating music generation process.......')
network_input = get_inputSequences(notes,pitchnames,n_vocab)
model = create_network(normalized_input,n_vocab)
print('Loading Model weights.....')
model.load_weights('weights.best.music3.hdf5')
print('Model Loaded')
prediction_output = generate_notes(model,network_input,n_vocab)
create_midi(prediction_output)
问题如下:
Initiating music generation process.......
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-24-b97e0091fa1b> in <module>()
----> 1 generate()
<ipython-input-20-27d37a8858b8> in generate()
13
14 network_input = get_inputSequences(notes,n_vocab)
---> 15 model = create_network(normalized_input,n_vocab)
16 print('Loading Model weights.....')
17 model.load_weights('weights.best.music3.hdf5')
NameError: name 'normalized_input' is not defined
由于代码不是我的,我不知道这个变量是什么,所以我可以修复它... 我给代码所有者发了电子邮件,但他没有回复。
谢谢