llSourcell / Music_Generator_Demo

Music Generator Demo by @Sirajology on Youtube
246 stars 123 forks source link

Does not work on Windows platform #15

Open sksar opened 7 years ago

sksar commented 7 years ago

I tried to run this in windows but it did not work as one of it's dependencies does not support windows..

The python-midi library is required by the midi_manipulation.py script. But unfortunately the python-midi library requires the ALSA Sequncer which is only for Linux, so this does not work on Windows...

I tried to install python-midi, but it fails.. Upon investigation the setup code i found this

# currently, only the ALSA sequencer is supported
    if platform.startswith('linux'):
        setup_alsa(ns)
        pass
    else:
        print("No sequencer available for '%s' platform." % platform)

I think there is need of something else to be done so that it works across all platforms..

RifatBinReza commented 7 years ago

Try this: pip3 install git+https://github.com/vishnubob/python-midi@feature/python3

mschultheiss83 commented 7 years ago

@llSourcell maybe add to readme

### Dependencies on Windows with python3

    pip3 install pandas
    pip3 install msgpack-python
    pip3 install numpy
    pip3 install glob2
    pip3 install tqdm
    pip3 install git+https://github.com/vishnubob/python-midi@feature/python3
mschultheiss83 commented 7 years ago
maybe this helps if you switch to tensorflow >= 1.0.0 

after that i get

Traceback (most recent call last):
  File "rbm_chords.py", line 106, in <module>
    W_adder = tf.mul(lr / size_bt, tf.sub(tf.matmul(tf.transpose(x), h), tf.matmul(tf.transpose(x_sample), h_sample)))
AttributeError: module 'tensorflow' has no attribute 'mul'

so this helped me

https://stackoverflow.com/questions/42217059/tensorflowattributeerror-module-object-has-no-attribute-mul

You'll need to replace tf.mul with tf.multiply.
You'll need to replace tf.sub with tf.subtract.
mschultheiss83 commented 7 years ago

my next error

Traceback (most recent call last):
  File "rbm_chords.py", line 127, in <module>
    song = song[:np.floor(song.shape[0] / num_timesteps) * num_timesteps]
TypeError: slice indices must be integers or None or have an __index__ method

change rbm_chords.py:129 to

          song = song[:int(np.floor(song.shape[0] // num_timesteps) * num_timesteps)]
mschultheiss83 commented 7 years ago

btw to hide tensorflow warnings add at the bottom of the import block

import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
mschultheiss83 commented 7 years ago

see https://github.com/mschultheiss83/Music_Generator_Demo for my fixes