Questions tagged [sess.run]

8 questions
4
votes
1 answer

sess.run() is too slow

The sess.run() function by the Tensorflow object detection module takes about 2.5 seconds to detect bounding bozes in a 600x600 image. How can I speed up this code? def run(image, detection_graph): with detection_graph.as_default(): with…
SKAE
  • 83
  • 1
  • 10
1
vote
0 answers

Can I run 2 sessions in parallel using Tensorflow V1? Is it correct to write the programming in the following manner?

I would like to optimise 2 optimisers/ functions using the tensorflow v1 using the training set, hence would like to run the 2 optimisers in parallel. import tensorflow.compat.v1 as tf tf.disable_v2_behavior() # ... loss_i1 = -…
Dione Goh
  • 11
  • 1
1
vote
1 answer

Issue with feeding value into placeholder tensor for sess.run()

I want to get the value of an intermediate tensor in a convolutional neural network for a specific input. I know how to do this in keras and even though I have trained a model using keras, I'm going to move towards constructing and training the…
Jane Sully
  • 3,137
  • 10
  • 48
  • 87
1
vote
0 answers

Sess.run with string variable name

I have been studying the book "Tensor flow for Dummies" and there is a piece of code to restore variables earlier stored with tf.Session() as sess: # Load stored graph into current graph saver = tf.train.import_meta_graph('output.meta') # Restore…
0
votes
0 answers

Training with a loss function consisting of two part based on two different dataset

The loss function is defined as shown in the link The training is based on two different dataset i and k, which corresponds to the two different parts of the loss function. I would like to train using for epoch in range(training_epochs): …
0
votes
1 answer

Speeding up Inference time on GPT2 - optimizing tf.sess.run()

I am trying to optimize the inference time on GPT2. The current time to generate a sample after calling the script is 55 secs on Google Colab. I put in timestamps to try to isolate where the bottleneck is. This is the code: for _ in range(nsamples…
0
votes
1 answer

TensorFlow RNN example from book (word2vec, embeddings, )

Guided by the book with name "Learning TensorFlow. A Guide to Building Deep Learning Systems (Tom Hope, Yehezkel S. Reshe , and Itay Lieder)" I'm trying to implement simple RNN network with word2vec approach. On page 101 (Chapter 6, Text II: Word…
DustyDust
  • 5
  • 3
0
votes
0 answers

Training Mini-batches of data (without labels) for unsupervised learning

Has anyone trained mini-batches of data for an unsupervised learning problem? The feed_dict uses the label and in an unsupervised setting. How do you overcome that? Could we use fake labels that never contribute to the loss function? Basically, I…