neural_artistic_style
neural_artistic_style copied to clipboard
Unkonw exception in imread(path) from neural_artistic_style.py
I got this fault:
/usr/lib/python2.7/dist-packages/pkg_resources/init.py:1224: UserWarning: /home/anonym/.python-eggs is writable by group/others and vulnerable to attack when used with get_resource_filename. Consider a more secure location (set with .set_extraction_path or the PYTHON_EGG_CACHE environment variable).
warnings.warn(msg, UserWarning)
CUDArray: CUDA back-end not available, using NumPy.
Traceback (most recent call last):
File "neural_artistic_style.py", line 120, in
Have any ideas?
Strange, make sure scipy.misc.imread(path)
returns a NumPy array.
That's right? (screen from my attempt to find out the cause)
Hm, it seems to me that scipy.misc.imread()
is returning a PIL object. If this is the case, you need fix your scipy
installation such that it can read your images. Try to look it up on the web.
I saw this same error, and was able to fix it by doing the following (not sure which are responsible, since I did them all at once):
- install
scikit-image
andmatplotlib
; the latter may have unmet dependencies -uninstall anyscipy
version, and install again withsudo pip install pip install git+https://github.com/scipy/scipy.git
- uninstall
Pillow
- install all of the external libraries listed here required by Pillow: http://pillow.readthedocs.org/en/latest/installation.html#external-libraries (my guess is that installing one/some of these is what made the difference)
- reinstall
Pillow
@rmurray2: Thank you for the insight! Another possibility is to use the Anaconda Python distribution. It usually provides working versions of Pillow/Scipy. :)