Skip to content

Commit

Permalink
Docker file for v.6.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Nabeel committed Jan 12, 2020
1 parent 722d97f commit 9e67c33
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 27 deletions.
27 changes: 0 additions & 27 deletions core/_machine_learning.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,24 +96,6 @@ def save(self, name, path, overwrite=True, compress=3, locked_timeout=2):

# The Keras estimator is excluded from the model saved to the joblib file
self.pipe.named_steps['estimator'].model = None
#self.pipe.steps[self.estimation_step] = ('estimator', None)

# Deconstruct the pipeline for pickling
#self.pipe_steps = []
#for step in self.pipe.steps:
# if step[0] != 'estimator':
# self.pipe_steps.append(step)
# else:
# self.pipe_steps.append(('estimator', None))

# Delete the pipe to avoid pickling errors due to tensorflow remnants
#del self.pipe

# Avoid pickling errors due to tensorflow session remnants
#sess = kerasbackend.get_session()
#kerasbackend.clear_session()
#sess.close()
#gc.collect()
except AttributeError:
pass

Expand Down Expand Up @@ -146,15 +128,6 @@ def load(self, name, path):
# https://stackoverflow.com/questions/40785224/tensorflow-cannot-interpret-feed-dict-key-as-tensor
kerasbackend.clear_session()

# Re-create the pipeline
#self.pipe = Pipeline(self.pipe_steps)

# Re-create the scikit-learn wrapper for Keras
#if self.estimator_type == "classifier":
# self.pipe.steps[self.estimation_step] = ('estimator', KerasClassifierForQlik(**self.estimator_kwargs))
#else:
# self.pipe.steps[self.estimation_step] = ('estimator', KerasRegressorForQlik(**self.estimator_kwargs))

# Load the keras model architecture and weights from disk
keras_model = keras.models.load_model(path + name + '.h5')
keras_model._make_predict_function()
Expand Down
14 changes: 14 additions & 0 deletions docker/Dockerfile v.6.3
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Use the previous version of qlik-py-tools as a parent image
FROM nabeeloz/qlik-py-tools:6.2

# Set the working directory to /qlik-py-tools/core
WORKDIR /qlik-py-tools/core

# Copy all files from the core subdirectory into the container
COPY ./core/* /qlik-py-tools/core/

# Make ports 80 and 50055 available to the world outside this container
EXPOSE 80 50055

# Run __main__.py when the container launches
CMD ["python", "__main__.py"]

0 comments on commit 9e67c33

Please sign in to comment.