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

ImportError: cannot import name 'imread' #64

Closed
Ruqyai opened this issue Feb 21, 2020 · 5 comments
Closed

ImportError: cannot import name 'imread' #64

Ruqyai opened this issue Feb 21, 2020 · 5 comments

Comments

@Ruqyai
Copy link

Ruqyai commented Feb 21, 2020

Traceback (most recent call last):
File "Neural-Style-Transfer/color_transfer.py", line 9, in
from scipy.misc import imread, imresize, imsave, fromimage, toimage
ImportError: cannot import name 'imread'

@elctrc
Copy link

elctrc commented Mar 2, 2020

@Ruqyai you, like me, likely installed the most recent version of SciPy, which no longer contains the imread method. See here: https://docs.scipy.org/doc/scipy-1.2.1/reference/generated/scipy.misc.imread.html

I have tried using imageio - you need to also update line 116 and change the parameter "mode" to "pilmode". But tbh even after doing that I am just getting different errors:

Traceback (most recent call last): File "color_transfer.py", line 116, in <module> generated_image = imread(args.generated_image, pilmode="RGB") File "/home/kidd/anaconda3/envs/nst/lib/python3.7/site-packages/imageio/core/functions.py", line 264, in imread reader = read(uri, format, "i", **kwargs) File "/home/kidd/anaconda3/envs/nst/lib/python3.7/site-packages/imageio/core/functions.py", line 182, in get_reader "Could not find a format to read the specified file " "in mode %r" % mode ValueError: Could not find a format to read the specified file in mode 'i'

@darshana1406
Copy link

In the color_transfer.py file add this:
from utils import imread, imresize, imsave, fromimage, toimage
and remove this:
from scipy.misc import imread, imresize, imsave, fromimage, toimage

@dkarma
Copy link

dkarma commented Dec 22, 2021

it's really sad that great projects like these get utterly destroyed by changes in the underlying libraries. basically this entire neural doodle tree is completely broken by depricated functions in scipy and other libraries.

imo devs have an obligation to tell people their stuff is broken (and pull it from github) if the underlying dependencies break.
this all needs to be rewritten and does not work as-is

@titu1994
Copy link
Owner

1- don't repeat your comment as a seperate issue (or instead don't paste your issue in other issues)

2-
I (or any other dev) have absolutely 0 obligation to do anything at all if the underlying libraries change and break an application. If I volunteer to maintain it then thats volunteering, not an obligation on my part.

Nothing stops you from volunteering some of your own time maintaining the project and sending PR to update it, so feel free to do that if you feel so strongly about it.

@Ruqyai Ruqyai closed this as completed Aug 9, 2022
@Ruqyai
Copy link
Author

Ruqyai commented Aug 9, 2022

.

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