• Evan Lezar's avatar
    Import scipy.ndimage before tensorflow to fix jpeg load. (#165) · c716c1b8
    Evan Lezar authored
    When importing tensorflow before scipi.ndimage and running the
    example in a docker container, the following error is given:
    
    ```
     % python example.py
    Traceback (most recent call last):
      File "example.py", line 25, in <module>
        im = im / 255.
    TypeError: unsupported operand type(s) for /: 'instance' and 'float'
    ```
    This only happens for 'cat.jpg'. When converting the image to a '.png'
    file, the example runs as expected.
    
    When swapping the imports around so that scipy.ndimage is imported
    BEFORE tensorflow, both 'jpg' and 'png' files work.
    c716c1b8
example.py 2.06 KB