-
Notifications
You must be signed in to change notification settings - Fork 22
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
Pip install from requirements.txt #7
Conversation
@MLnick I checked out the branch pip-dep and try it out. I still get the error below:
|
You need to rebuild the docker container
…On Mon, 30 Jul 2018 at 19:54, Xin Wu ***@***.***> wrote:
@MLnick <https://github.com/MLnick> I checked out the branch pip-dep and
try it out. I still get the error below:
File "/opt/conda/lib/python3.6/site-packages/flask/app.py", line 1813, in full_dispatch_request
rv = self.dispatch_request()
File "/opt/conda/lib/python3.6/site-packages/flask/app.py", line 1799, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/opt/conda/lib/python3.6/site-packages/flask_restplus/api.py", line 319, in wrapper
resp = resource(*args, **kwargs)
File "/opt/conda/lib/python3.6/site-packages/flask/views.py", line 88, in view
return self.dispatch_request(*args, **kwargs)
File "/opt/conda/lib/python3.6/site-packages/flask_restplus/resource.py", line 44, in dispatch_request
resp = meth(*args, **kwargs)
File "/opt/conda/lib/python3.6/site-packages/flask_restplus/marshalling.py", line 136, in wrapper
resp = f(*args, **kwargs)
File "/workspace/api/model.py", line 56, in post
generated_text = self.model_wrapper.predict(seed_text, gen_chars)
File "/workspace/core/backend.py", line 84, in predict
preds = self.model.predict(x, verbose=0)[0]
File "/opt/conda/lib/python3.6/site-packages/keras/models.py", line 1025, in predict
steps=steps)
File "/opt/conda/lib/python3.6/site-packages/keras/engine/training.py", line 1832, in predict
self._make_predict_function()
File "/opt/conda/lib/python3.6/site-packages/keras/engine/training.py", line 1029, in _make_predict_function
**kwargs)
File "/opt/conda/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py", line 2502, in function
return Function(inputs, outputs, updates=updates, **kwargs)
File "/opt/conda/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py", line 2445, in __init__
with tf.control_dependencies(self.outputs):
File "/opt/conda/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 5027, in control_dependencies
return get_default_graph().control_dependencies(control_inputs)
File "/opt/conda/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 4631, in control_dependencies
c = self.as_graph_element(c)
File "/opt/conda/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 3590, in as_graph_element
return self._as_graph_element_locked(obj, allow_tensor, allow_operation)
File "/opt/conda/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 3669, in _as_graph_element_locked
raise ValueError("Tensor %s is not an element of this graph." % obj)
ValueError: Tensor Tensor("activation_1/Softmax:0", shape=(?, 61), dtype=float32) is not an element of this graph.```
What did I miss ?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#7 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AA_SB3tL_SWDO-WyqU7OeY8soq1hwUkLks5uL0hSgaJpZM4VmKzm>
.
|
I mistake it with issue #4 . Should I combine these 2 PRs to get it work? |
Right, the fix in #6 will also need to be applied in order for |
pip install flask-restplus | ||
COPY requirements.txt /workspace | ||
RUN pip install --upgrade pip | ||
RUN pip install -r requirements.txt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we merge this into 1 command to reduce the number of layers?
My thinking was if one is developing or changing requirements then it also
will re-run the pip upgrade. But I guess the overhead is not too bad
…On Mon, 30 Jul 2018 at 20:43 Brendan Dwyer ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In Dockerfile
<#7 (comment)>
:
>
-# Python package versions
-ARG numpy_version=1.14.1
-ARG tf_version=1.5.0
-ARG keras_version=2.1.4
-
-RUN pip install --upgrade pip && \
- pip install numpy==${numpy_version} && \
- pip install tensorflow==${tf_version} && \
- pip install h5py && \
- pip install keras==${keras_version} && \
- pip install flask-restplus
+COPY requirements.txt /workspace
+RUN pip install --upgrade pip
+RUN pip install -r requirements.txt
Could we merge this into 1 command to reduce the number of layers?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#7 (review)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AA_SBz1EbYje6Q4TD4Jv0uXutSspCOzEks5uL1PlgaJpZM4VmKzm>
.
|
@MLnick I see |
@bdwyer2 changing the requirements file and rebuilding does actually trigger a new build of the layer due to the |
Any other comments on this? |
I tested this with the fix in #6 and it works for me. |
Update
Dockerfile
to install dependencies fromrequirements.txt
. Specify relevant dependency versions.