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

classify.py skimage error: ValueError: can not convert object to float64 #438

Closed
Kenosuke opened this issue May 22, 2014 · 5 comments
Closed

Comments

@Kenosuke
Copy link

Hi, I receive this error when running the python wrapper classify.py on ubuntu 12.04 server

Traceback (most recent call last):
  File "classify.py", line 161, in <module>
    main(sys.argv)
  File "classify.py", line 113, in main
    inputs = [caffe.io.load_image(str(args.input_file))]
  File "/home/ubuntu/caffe/caffe-dev/python/caffe/io.py", line 18, in load_image
    img = skimage.img_as_float(skimage.io.imread(filename)).astype(np.float32)
  File "/usr/local/lib/python2.7/dist-packages/skimage/util/dtype.py", line 287, in img_as_float
    return convert(image, np.float64, force_copy)
  File "/usr/local/lib/python2.7/dist-packages/skimage/util/dtype.py", line 99, in convert
    raise ValueError("can not convert %s to %s." % (dtypeobj_in, dtypeobj))
ValueError: can not convert object to float64.

The weird thing is when i tried running it on ubuntu 12.04 desktop using the same installation procedure, it works....

@shelhamer shelhamer changed the title Weird Classify.py error classify.py skimage error: ValueError: can not convert object to float64 May 28, 2014
@RawanMG
Copy link

RawanMG commented Jul 1, 2014

I'm getting the same error. Did you by any chance fix it?

@RawanMG
Copy link

RawanMG commented Jul 1, 2014

importing io and using 'matplotlib' fixed the issue

from skimage import io; io.use_plugin('matplotlib')

@ghost
Copy link

ghost commented Sep 29, 2014

For me, switching from PIL to pillow fixed a similar error.

@jabkim
Copy link

jabkim commented Feb 25, 2015

If you use PIL package uninstall it and use pillow.

@ivendrov
Copy link

I encountered this error on images in the COCO dataset. Switching from PIL to Pillow alone wasn't enough; I also had to add

from PIL import ImageFile
ImageFile.LOAD_TRUNCATED_IMAGES = True

as in this StackOverflow answer.

eisoku9618 added a commit to eisoku9618/kuroiwa_demos that referenced this issue Aug 3, 2016
eisoku9618 added a commit to eisoku9618/kuroiwa_demos that referenced this issue Dec 30, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants