I have to call a couple of numpy operations on TF-Tensors for which I didn't find any equivalent tensorflow functions. As far as I know the easiest (and only?) way to convert a tensor into a numpy array is to run a session. Unfortunately at this point the graph is not completely built yet, so I have to close this session to continue building up the graph and then later start a new session after the graph is built. When I start a new session my data loader chooses different samples (because of shuffling I guess) than it did in the first session so this doesn't work. Is there another way to convert my tensors to np.arrays without running the graph? Is it generally sensible to run more than one session if I want to use the same data samples do propagate through the graph? Any ideas to tackle this problem?
I already tried to use tf.python_func() but this only works for using eager execution. I wouldn't prefer to change my code base to use eager execution so I'm looking for a different way.
Thanks in advance and sorry for being a tensorflow noob.