0
votes

I am loading in my data via a shuffle_batch input pipeline. However, when I go to do training, I would like to train for a bit, then python some things, then continue training. However, I'm not sure how to get control of the thing back from the shuffle_batch reader and the filename queue. It just keeps reading and reading...

EDIT:: I realize that this is the "old way" to import data. However, I do not immediately see a way to remedy this with the "new way" https://www.tensorflow.org/versions/master/api_docs/python/tf/data/FixedLengthRecordDataset

How do I feed just 50 cifar records through my training pipeline and then recover control in my jupyter notebook?

1
Whilest you can limit the length of the input/dataset. I think what you want to do is related to how you run the training and tell it to only run for so many or a single step. Your code would help to provide more tailored advice. - de1
I am using a minorly altered version of the cifar10 tensorflow tutorial. github.com/tensorflow/models/blob/master/tutorials/image/… - Him

1 Answers

1
votes

Based on you using https://github.com/tensorflow/models/blob/master/tutorials/image/cifar10/ - the actual ltraining happens when it is executing the train_op. You should be able to put your logic there. e.g.:

while not mon_sess.should_stop():
  mon_sess.run(train_op)
  if mon_sess.run(global_step) % 10 == 0:
    # do something special

Otherwise it also supports a max_steps parameter which would probably be similar to you trying to limit the input. But wouldn't be so useful if you then want to continue training.