Question: ***my codes is as follow:***

```
import tensorflow as tf
import numpy as np
def add_layer(input):
    v2 = tf.Variable(tf.random_normal([2, 2], dtype=tf.float32, name='v2'))
    tf.add_to_collection('h0_v2',v2)
    output=tf.matmul(input,v2)
    return output
x1=tf.placeholder(tf.float32)
outputs=add_layer(x)
tf.add_to_collection('outputs', outputs)
saver = tf.train.Saver()
with tf.Session() as sess:
    sess.run(tf.global_variables_initializer())
    x1=np.random.random([2, 2])
    print(sess.run(outputs,feed_dict={x:x1}))
    save_path = saver.save(sess, './model.ckpt')
    print("model saved in file:", save_path)

```

**and then another codes is runned:**

```
import tensorflow as tf
import numpy as np
sess = tf.Session()
saver = tf.train.import_meta_graph('./model.ckpt.meta')
saver.restore(sess, tf.train.latest_checkpoint('./'))
x2=np.random.random([2, 2])
print(sess.run(tf.get_collection('outputs',feed_dict={x:x2})))
print('model is loaded')
sess.close()

```

**and then computer tells me that the 'x' is not defined, I do not know what is wrong.**

Answer: 
> 
> I think it's unnecessary to add those to all the page's of my project,
>  right?
> 
> 
> 

The sidemenu content needs to be added only once, in the `app.html` file. But regarding the navbar, as you can see in [this SO post](https://stackoverflow.com/questions/35936198/ionic-2-global-navbar-for-the-app/37808988#37808988), @mhartington (from Ionic Team) says:

> 
> **There is no way to create a global ion-navbar**, as this is done on purpose. The point of having a navbar defined for each component is so
>  that we can properly animate the titles, navbar background color (if
>  you change them) and animate other properties needed.
> 
> 
> 

And about creating a custom directive to avoid duplicating ion-navbar html code (I guess this is what you were thinking of):

> 
> That will still creat errors with how angular2 content projection
>  works. We have several issues that have been open when people try this
>  and **the best answer is to not do it**.
> 
> 
>
There is an Ionic 2 sidemenu starter, which is a perfect starter for you t start with for your application like you need it to be.
[Follow this link](https://github.com/driftyco/ionic2-starter-sidemenu)

It has sidemenu component and you can build on top and add pages as you wish