# Load keras "Functional" model

**URL:** <https://community.konduit.ai/t/load-keras-functional-model/612>\
**Category:** Uncategorized\
**Created:** [June 13, 2020, 6:48pm UTC](https://community.konduit.ai/t/load-keras-functional-model/612 "2020-06-13T18:48:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![FanDev](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/fandev/32/231_2.png) [@FanDev](https://community.konduit.ai/u/FanDev)\
**Post date:** [June 13, 2020, 6:48pm UTC](https://community.konduit.ai/t/load-keras-functional-model/612/1 "2020-06-13T18:48:15Z")

</div>

Does DL4J load “Functional” model? The tutorial shows we need to generate “Sequential” model in order to load in to DL4J.

> To import a Keras model, you need to create and [serialize](https://keras.io/getting-started/faq/#how-can-i-save-a-keras-model) such a model first.

**Sequential model example:**

```auto
model = keras.Sequential([keras.Input((32,)), keras.layers.Dense(1)])config = model.get_config()new_model = keras.Sequential.from_config(config)

```

**Functional model example:**

```auto
inputs = keras.Input((32,))outputs = keras.layers.Dense(1)(inputs)model = keras.Model(inputs, outputs)config = model.get_config()new_model = keras.Model.from_config(config)

```

---

<div class="post-metadata">

**Author:** ![treo](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/treo/32/47_2.png) [@treo](https://community.konduit.ai/u/treo)\
**Post date:** [June 13, 2020, 7:02pm UTC](https://community.konduit.ai/t/load-keras-functional-model/612/2 "2020-06-13T19:02:09Z")

</div>

When you take a look at the documentation you find that it does support functional model import: [https://deeplearning4j.konduit.ai/keras-import/model-functional](https://deeplearning4j.konduit.ai/keras-import/model-functional)

---

<div class="post-metadata">

**Author:** ![FanDev](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/fandev/32/231_2.png) [@FanDev](https://community.konduit.ai/u/FanDev)\
**Post date:** [June 13, 2020, 7:14pm UTC](https://community.konduit.ai/t/load-keras-functional-model/612/3 "2020-06-13T19:14:30Z")

</div>

Ah, OK, thanks. I am still struggling to load my model with UpSampling3D error as shown in another thread. I am trying to test different senarios like this “Sequential” model.

I downloaded another model from someone else which also contains UpSampling3D model, it shows same error.:

> **[pretrained\_model.hdf5](https://drive.google.com/file/d/1AL0uRqBa0umRc-xHTOuviCc4XWbxWj1j/view?usp=sharing)**
>
> Google Drive file.
