Virtual-Makeup icon indicating copy to clipboard operation
Virtual-Makeup copied to clipboard

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

Open hafquangbaox opened this issue 8 years ago • 4 comments

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

hafquangbaox avatar Oct 10 '17 01:10 hafquangbaox

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

kirthu30 avatar Mar 09 '18 08:03 kirthu30

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

biyuehuang avatar Dec 25 '18 14:12 biyuehuang

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

setsabile avatar May 06 '19 09:05 setsabile

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')

CennyMo avatar Dec 01 '19 08:12 CennyMo