2
$\begingroup$

Aurelion Geron's example shows how to stored selected operations in a collection, so they can then be easily accessed later:

Adding:

for op in (X, y, accuracy, training_op):
    tf.add_to_collection("my_important_ops", op)

Then retrieving:

X, y, accuracy, training_op = tf.get_collection("my_important_ops")

However when I try to do this I get this error:

X, y, accuracy, training_op = tf.get_collection("my_important_ops")
ValueError: too many values to unpack (expected 4)

What am I doing wrong?

$\endgroup$
0
$\begingroup$

A simple solution is to do the following:

temp = tf.get_collection("my_important_ops")
print(temp.get_shape().as_list())

Then you can evaluate the outputs.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.