TypeError: 'float' object cannot be interpreted as an integer
Opened this issue · 3 comments
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
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
installing numpy 1.11.0 is giving timeout error. Is there any alternate path present?
command used --> pip install numpy==1.11.0
Change line 117's
song.shape[0]/num_timesteps
to
song.shape[0]//num_timesteps
which changes it to integer division