# TensorFlow.jl - Export/Import Meta Graph?

**URL:** <https://discourse.julialang.org/t/tensorflow-jl-export-import-meta-graph/9108>\
**Category:** Machine Learning\
**Created:** [February 16, 2018, 9:30am UTC](https://discourse.julialang.org/t/tensorflow-jl-export-import-meta-graph/9108 "2018-02-16T09:30:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![einem83](https://avatars.discourse-cdn.com/v4/letter/e/35a633/32.png) [@einem83](https://discourse.julialang.org/u/einem83)\
**Post date:** [February 16, 2018, 9:30am UTC](https://discourse.julialang.org/t/tensorflow-jl-export-import-meta-graph/9108/1 "2018-02-16T09:30:43Z")

</div>

Hi experts

i am struggling with exporting and importing a meta\_graph in TensorFlow.jl:

tensorflow 1.4.0  
TensorFlow.jl 0.8.0  
julia 0.6.2

Here an example,. where i am struggling:

```julia
using TensorFlow
session = Session(Graph())
x = placeholder(Float32)
@tf W=get_variable([2,2],Float32)
test= x*W
train.export_meta_graph("test.meta")

```

when i am trying to import the meta graph in a new session like:

```julia
using TensorFlow
session = Session(Graph())
train.import_meta_graph("test.meta")

```

i get following error:

```julia
ERROR: Tensorflow error: Status: Shape must be rank 2 but is rank 0 for 'test' (op: 'MatMul') with input shapes: [], [2,2].

```

i tried different variations, like providing a shape=[-1,2] to the placeholder variable, but it doesnt help.

doing the same but w/o the “test = x\*W” part works, so it seems that during the import step the shapes for the matmul are not defined (for x), even if provided.

Maybe someone can point me to my mistake here…

Thanks a lot in advance

best Daniel

---

<div class="post-metadata">

**Author:** ![menahem](https://avatars.discourse-cdn.com/v4/letter/m/43a26b/32.png) [@menahem](https://discourse.julialang.org/u/menahem)\
**Post date:** [May 7, 2018, 9:13am UTC](https://discourse.julialang.org/t/tensorflow-jl-export-import-meta-graph/9108/2 "2018-05-07T09:13:29Z")

</div>

facing the same problem, did you found a solution?  
Best, Menahem Pirchi

---

<div class="post-metadata">

**Author:** ![menahem](https://avatars.discourse-cdn.com/v4/letter/m/43a26b/32.png) [@menahem](https://discourse.julialang.org/u/menahem)\
**Post date:** [May 7, 2018, 9:14am UTC](https://discourse.julialang.org/t/tensorflow-jl-export-import-meta-graph/9108/3 "2018-05-07T09:14:47Z")

</div>

Hi experts

i am struggling with exporting and importing a meta\_graph in TensorFlow.jl:

tensorflow 1.4.0

TensorFlow.jl 0.8.0

julia 0.6.2

Here an example,. where i am struggling:

```julia
using TensorFlow
session = Session(Graph())
x = placeholder(Float32)
@tf W=get_variable([2,2],Float32)
test= x*W
train.export_meta_graph("test.meta")

```

when i am trying to import the meta graph in a new session like:

```julia
using TensorFlow
session = Session(Graph())
train.import_meta_graph("test.meta")

```

i get following error:

```julia
ERROR: Tensorflow error: Status: Shape must be rank 2 but is rank 0 for 'test' (op: 'MatMul') with input shapes: [], [2,2].

```

i tried different variations, like providing a `shape=[-1,2]` to the placeholder variable, but it doesnt help.

doing the same but w/o the `test = x*W` part works, so it seems that during the import step the shapes for the matmul are not defined (for x), even if provided.

Maybe someone can point me to my mistake here…

Thanks a lot in advance  
Menahem Pirchi
