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

Image Stylization jupyter book doesn't work on Windows #73

Open
SidShetye opened this issue May 14, 2019 · 1 comment
Open

Image Stylization jupyter book doesn't work on Windows #73

SidShetye opened this issue May 14, 2019 · 1 comment
Assignees

Comments

@SidShetye
Copy link

Two issues.

1. OS agnostic path delimiting needed

In magenta-demos/jupyter-notebooks/Image_Stylization.ipynb at line 38 os.path.join(example_path, 'evaluation_images/guerrillero_heroico.jpg') should be os.path.join(example_path, 'evaluation_images', 'guerrillero_heroico.jpg')

2. image_utils.load_np_image failure

This is then followed by an error inside image_utils.load_np_image (line 48). Here the call attempts to load the image into a temp file but that temp file is garbage collected / disposed / deleted before the call returns.

~\Anaconda3\envs\tensorflow\lib\site-packages\magenta\models\image_stylization\image_utils.py in load_np_image(image_file)
    389     with values in [0, 1].
    390   """
--> 391   return np.float32(load_np_image_uint8(image_file) / 255.0)
    392 
    393 

~\Anaconda3\envs\tensorflow\lib\site-packages\magenta\models\image_stylization\image_utils.py in load_np_image_uint8(image_file)
    405     f.write(tf.gfile.GFile(image_file, 'rb').read())
    406     f.flush()
--> 407     image = scipy.misc.imread(f.name)
    408     # Workaround for black-and-white images
    409     if image.ndim == 2:

~\Anaconda3\envs\tensorflow\lib\site-packages\numpy\lib\utils.py in newfunc(*args, **kwds)
     99             """`arrayrange` is deprecated, use `arange` instead!"""
    100             warnings.warn(depdoc, DeprecationWarning, stacklevel=2)
--> 101             return func(*args, **kwds)
    102 
    103         newfunc = _set_function_name(newfunc, old_name)

~\Anaconda3\envs\tensorflow\lib\site-packages\scipy\misc\pilutil.py in imread(name, flatten, mode)
    162     """
    163 
--> 164     im = Image.open(name)
    165     return fromimage(im, flatten=flatten, mode=mode)
    166 

~\Anaconda3\envs\tensorflow\lib\site-packages\PIL\Image.py in open(fp, mode)
   2650 
   2651     if filename:
-> 2652         fp = builtins.open(filename, "rb")
   2653         exclusive_fp = True
   2654 

PermissionError: [Errno 13] Permission denied: 'C:\\Users\\lab\\AppData\\Local\\Temp\\tmpkvttffnd'

Note that C:\\Users\\lab\\AppData\\Local\\Temp\\tmpkvttffnd doesn't exist at the time of the error.

@romanoss
Copy link

same

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

3 participants