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: 'numpy.float64' object cannot be interpreted as an integer #1

Open
hafquangbaox opened this issue Oct 10, 2017 · 4 comments

Comments

@hafquangbaox
Copy link

Your code has many error when i run with python3, please help me check this :(

Kakalot:eyeshadow kakalot$ python3 eyeshadow.py
Traceback (most recent call last):
File "eyeshadow.py", line 115, in
ext(u_l0,l_l0+1,i)
File "eyeshadow.py", line 31, in ext
y.extend((ones(b-a)*i).tolist())
File "/usr/local/lib/python3.6/site-packages/numpy/core/numeric.py", line 192, in ones
a = empty(shape, dtype, order)
TypeError: 'numpy.float64' object cannot be interpreted as an integer

@kirthu30
Copy link

kirthu30 commented Mar 9, 2018

Try sudo pip install -U numpy==1.11.0, it works for me then.

@biyuehuang
Copy link

MODIFY y.extend((ones(b-a)*i).tolist()) TO y.extend((ones(int(b-a), dtype=np.int32)*i).tolist())

@setsabile
Copy link

val = color.rgb2lab((im[x, y] / 255.).reshape(len(x), 1, 3)).reshape(len(x), 3)
IndexError: only integers, slices (:), ellipsis (...), numpy.newaxis (None) and integer or boolean arrays are valid indices
I have encounter this problem guys please help

@CennyMo
Copy link

CennyMo commented Dec 1, 2019

my resolution:
if problem is:
'numpy.float64' object cannot be interpreted as an integer
then use the resolution written by biyuehuang

if the problem is:
ValueError:assignment destination is read-only
in line im[x,y] = color.lab2rgb(val.reshape(len(x),1,3)).reshape(len(x),3)*255
then MODIFY im=imread('input.jpg') to im=np.array(imread('input.jpg'), im2=np.array(imread('input.jpg')

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

5 participants