llSourcell / Music_Generator_Demo

Music Generator Demo by @Sirajology on Youtube
247 stars 124 forks source link

TypeError: 'float' object cannot be interpreted as an integer #23

Open vorkuta opened 6 years ago

vorkuta commented 6 years ago

Tried running the sample and got the result below.

Traceback (most recent call last): File "/Users/MG-hooper/Desktop/TF/lib/python3.6/site-packages/numpy/core/fromnumeric.py", line 57, in _wrapfunc return getattr(obj, method)(*args, **kwds) TypeError: 'float' object cannot be interpreted as an integer

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "rbm_chords.py", line 117, in song = np.reshape(song, [song.shape[0]/num_timesteps, song.shape[1]num_timesteps]) File "/Users/MG-hooper/Desktop/TF/lib/python3.6/site-packages/numpy/core/fromnumeric.py", line 232, in reshape return _wrapfunc(a, 'reshape', newshape, order=order) File "/Users/MG-hooper/Desktop/TF/lib/python3.6/site-packages/numpy/core/fromnumeric.py", line 67, in _wrapfunc return _wrapit(obj, method, args, *kwds) File "/Users/MG-hooper/Desktop/TF/lib/python3.6/site-packages/numpy/core/fromnumeric.py", line 47, in _wrapit result = getattr(asarray(obj), method)(args, **kwds) TypeError: 'float' object cannot be interpreted as an integer

vorkuta commented 6 years ago

Update - uninstalled numpy and went back to 1.11.0 and it worked fine. If anyone else has issues then roll back.

Note:

/Users/*******/Desktop/TF/lib/python3.6/site-packages/numpy/core/fromnumeric.py:225: VisibleDeprecationWarning: using a non-integer number instead of an integer will result in an error in the future

saurabhrathor commented 6 years ago

installing numpy 1.11.0 is giving timeout error. Is there any alternate path present?

command used --> pip install numpy==1.11.0

amanojeremie commented 6 years ago

Change line 117's song.shape[0]/num_timesteps to song.shape[0]//num_timesteps which changes it to integer division