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

[WSL?] 'numpy.float64' object cannot be interpreted as an integer #71

Open
ankineri opened this issue May 4, 2019 · 0 comments
Open

Comments

@ankineri
Copy link

ankineri commented May 4, 2019

Tried to run ttpy on WSL today, ran into the following issue when running this trivial code:
tt.unit(2, 2)

TypeError                                 Traceback (most recent call last)
<ipython-input-2-f256968648f6> in <module>
----> 1 tt.unit(2, 2)

~/.local/lib/python3.5/site-packages/tt/core/tools.py in unit(n, d, j, tt_instance)
    788 
    789     for k in xrange(d):
--> 790         rv.append(_np.zeros((1, n[k], 1)))
    791         rv[-1][0, j[k], 0] = 1
    792     if tt_instance:

TypeError: 'numpy.float64' object cannot be interpreted as an integer

np.ones() returns an np.float64 array, which can not be used to specify shape.
I have fixed it for myself by using dtype=int in two place, namely the above function unit and twice in ind2sub, but I believe this will be in more places.

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

1 participant