Skip to content

Keras Load Model

Python node : launch with punchplatform-pyspark.sh or the punch UI job-editor with environment pyspark.

This node load a keras model save with a .h5 format, and send it to the next node trough the output stream

It takes only one setting : - path : the full path to the saved model

Example configuration :

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
        {
            type: keras_load_model
            component: model_load
            settings:{
                path: my_model.h5
            }
            publish: [
                {
                    stream: model
                }
            ]
        }

Example of complete pipeline :

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
{
  type: pyspark
  runtime_id: simpleJob
  job: [
        {
            type: keras_data_input
            component: data_input
            publish: [
                {
                    stream: x_test
                }
            ]
        }

        {
            type: keras_load_model
            component: model_load
            settings:{
                path: my_model.h5
            }
            publish: [
                {
                    stream: model
                }
            ]
        }

        {
            type: keras_eval_stream
            component: my_keras

            subscribe: [
                {
                    component: data_input
                    stream: x_test
                }

                {
                    component: model_load
                    stream: model
                }
            ]
            publish: [
                {
                    stream: predicts
                }
            ]
        }

        {
            type: show
            component: show,
            subscribe: [
              {
                component: my_keras
                stream: predicts
              }
            ]
        }
  ]
}