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

Create powerai-based dockerfile, powerai builds for x86/ppc #16

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mattborgard
Copy link
Member

No description provided.

@mattborgard
Copy link
Member Author

It looks like there's an actual functional error:

Traceback (most recent call last):
  File "/opt/anaconda3/lib/python3.6/site-packages/flask/app.py", line 1813, in full_dispatch_request
    rv = self.dispatch_request()
  File "/opt/anaconda3/lib/python3.6/site-packages/flask/app.py", line 1799, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/opt/anaconda3/lib/python3.6/site-packages/flask_restplus/api.py", line 319, in wrapper
    resp = resource(*args, **kwargs)
  File "/opt/anaconda3/lib/python3.6/site-packages/flask/views.py", line 88, in view
    return self.dispatch_request(*args, **kwargs)
  File "/opt/anaconda3/lib/python3.6/site-packages/flask_restplus/resource.py", line 44, in dispatch_request
    resp = meth(*args, **kwargs)
  File "/workspace/api/predict.py", line 51, in post
    return send_file(self.model_wrapper.write_image(output_image), mimetype='image/png', attachment_filename='result.png')
  File "/workspace/core/model.py", line 103, in write_image
    skimage.io.imsave(stream, image)
  File "/opt/anaconda3/lib/python3.6/site-packages/skimage/io/_io.py", line 144, in imsave
    return call_plugin('imsave', fname, arr, plugin=plugin, **plugin_args)
  File "/opt/anaconda3/lib/python3.6/site-packages/skimage/io/manage_plugins.py", line 210, in call_plugin
    return func(*args, **kwargs)
  File "/opt/anaconda3/lib/python3.6/site-packages/imageio/core/functions.py", line 259, in imwrite
    writer = get_writer(uri, format, "i", **kwargs)
  File "/opt/anaconda3/lib/python3.6/site-packages/imageio/core/functions.py", line 183, in get_writer
    "Could not find a format to write the specified file " "in mode %r" % mode
ValueError: Could not find a format to write the specified file in mode 'i'

@mattborgard
Copy link
Member Author

@splovyt If you have any insight on the imagio error, I'd appreciate it! I'll try upgrading Flask from 1.0.1 back to 1.1.1 (not a trivial change on the powerai image, but if it's required, we can make it work) to see if it makes any difference here.

@splovyt
Copy link
Contributor

splovyt commented Aug 30, 2019

Hi @mattborgard, thanks for your PR! Would it be possible to specify the library versions in your requirements file? That way, we know for sure that we are on the same page there.

Your current requirements-pai.txt:

Pillow
tensorflow
scikit-image
imageio

Aligning this with the requirements.txt file, this can be changed to:

Pillow==5.4.1
tensorflow==1.12.2
scikit-image==0.14.2
imageio==2.5.0

Feel free to change the tensorflow version if you cannot set it to 1.12.2, the problem is likely not there anyways. If the issue persists, I'll take a deeper look! Thank you!

@mattborgard
Copy link
Member Author

One of the issues with a powerai base is that most of the packages are pinned to very specific versions. Some of these can be updated to different versions, but this causes a downgrade to tensorflow which defeats the purpose of our conda install (this specific install through powerai's channel means we don't have to worry about license issues, etc).

This package versions can likely be changed if necessary with the powerai team, but we will probably need to identify exactly where the issue lies. I can list what is currently installed in the image:

pillow 6.1.0
tensorflow 1.14.0
scikit-image 0.15.0
imageio 2.5.0

RUN ["/bin/bash", "-c", "cd /opt/anaconda3/bin && source activate base && IBM_POWERAI_LICENSE_ACCEPT=yes ./accept-powerai-license.sh" ]

COPY . /workspace
RUN md5sum -c md5sums.txt # check file integrity
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
RUN md5sum -c md5sums.txt # check file integrity
# check file integrity
RUN md5sum -c md5sums.txt

https://docs.docker.com/engine/reference/builder/

Docker treats lines that begin with # as a comment, unless the line is a valid parser directive. A # marker anywhere else in a line is treated as an argument. This allows statements like:

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

Successfully merging this pull request may close these issues.

3 participants