TensorFlow operation 'tf.train.match_filenames_once ' not working

Viewed 2977

I have following code for reading files names from directory:

directory = "C:/pics/*.csv"
file_names=tf.train.match_filenames_once(directory)
print(file_names)
<tf.Variable 'matching_filenames_1:0' shape=<unknown> dtype=string_ref>

with tf.Session() as sess:
    tf.global_variables_initializer().run()
    print(sess.run(file_names))

When I run session I am getting the following error: " Attempting to use uninitialized value matching_filenames"

Please tell me what I am doing wrong.

1 Answers
Related