Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
vorkuta opened this issue Sep 18, 2017 · 3 comments
Open

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

vorkuta opened this issue Sep 18, 2017 · 3 comments

Comments

@vorkuta
Copy link

vorkuta commented Sep 18, 2017

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
Copy link
Author

vorkuta commented Sep 18, 2017

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
Copy link

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

command used --> pip install numpy==1.11.0

@amanojeremie
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants