TypeError: 'numpy.float64' object cannot be interpreted as an integer
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
Try sudo pip install -U numpy==1.11.0, it works for me then.
MODIFY y.extend((ones(b-a)*i).tolist()) TO y.extend((ones(int(b-a), dtype=np.int32)*i).tolist())
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
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')