2

I am using tensorflow 1.1.0 to run a code that is written with prior versions of tensorflow. It includes this part:

cell = tf.contrib.rnn.LSTMCell(num_units=64, state_is_tuple=True) outputs, last_states = tf.nn.dynamic_rnn( cell=cell, dtype=tf.float64, sequence_length=X_lengths, inputs=X) result = tf.contrib.learn.run_n( {"outputs": outputs, "last_states": last_states}, n=1, feed_dict=None) 

I get the following warning:

WARNING:tensorflow:From tensorflow/contrib/learn/python/learn/graph_actions.py:900: run_feeds_iter (from tensorflow.contrib.learn.python.learn.graph_actions) is deprecated and will be removed after 2017-02-15. Instructions for updating: graph_actions.py will be deleted. Use tf.train.* utilities instead. You can use learn/estimators/estimator.py as an example. 

I couldn't find the replacement of tf.contrib.learn.run_n in tensroflow 1.0+. Is there an alternative function that I can use instead?

1 Answer 1

1

I am not sure whether there is one function that can directly substitute the function in question. The following alternative should work without warnings:

n_iter = 1 result = [] with tf.Session() as sess: sess.run(tf.global_variables_initializer()) for i in range(n_iter): result_ = sess.run({'outputs': outputs, 'last_states':last_states}, feed_dict=None) result.append(result_) 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.