You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@madlib.apache.org by nk...@apache.org on 2020/12/09 00:39:13 UTC
[madlib] 04/07: DL: Update error msg for missing input_shape
This is an automated email from the ASF dual-hosted git repository.
nkak pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/madlib.git
commit d362b0e055fbf04a0f6f800ff6ed8f54a562d668
Author: Ekta Khanna <ek...@vmware.com>
AuthorDate: Fri Oct 30 12:12:28 2020 -0700
DL: Update error msg for missing input_shape
JIRA: MADLIB-1438
Previously, `keras` would error out if the first layer didn't have an
input shape but with `tf.keras` there is way to create a layer without
an input shape.(https://keras.io/examples/vision/mnist_convnet/). In
this case, the model JSON does not have it either. We need the input
shape for validation and also we cannot set model weights without the
input shape being added to the first layer.
Co-authored-by: Nikhil Kak <nk...@vmware.com>
---
src/ports/postgres/modules/deep_learning/model_arch_info.py_in | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/ports/postgres/modules/deep_learning/model_arch_info.py_in b/src/ports/postgres/modules/deep_learning/model_arch_info.py_in
index 3a225cc..8f7418b 100644
--- a/src/ports/postgres/modules/deep_learning/model_arch_info.py_in
+++ b/src/ports/postgres/modules/deep_learning/model_arch_info.py_in
@@ -39,7 +39,8 @@ def get_input_shape(model_arch):
arch_layers = _get_layers(model_arch)
if 'batch_input_shape' in arch_layers[0]['config']:
return arch_layers[0]['config']['batch_input_shape'][1:]
- plpy.error('Unable to get input shape from model architecture.')
+ plpy.error('Unable to get input shape from model architecture.'\
+ 'Make sure that the first layer defines an input_shape.')
def get_num_classes(model_arch):
"""