When I searched on internet, I see that this error can occur if the session variables are not initialized.
In your tutorial they are initialized. Moreover I haven't received this error when I do not use prettytensor and define the network in a conventional way using default tensorflow library.
Below is the error message.
Extracting /tmp/data/train-images-idx3-ubyte.gz
Extracting /tmp/data/train-labels-idx1-ubyte.gz
Extracting /tmp/data/t10k-images-idx3-ubyte.gz
Extracting /tmp/data/t10k-labels-idx1-ubyte.gz
WARNING:tensorflow:From /home/badami/Codes/deeplearning/tensorflow/local/lib/python2.7/site-packages/prettytensor/local_trainer.py:122 in _create_initializers.: all_variables (from tensorflow.python.ops.variables) is deprecated and will be removed after 2016-03-02.
Instructions for updating:
Please use tf.global_variables instead.
WARNING:tensorflow:From /home/badami/Codes/deeplearning/tensorflow/local/lib/python2.7/site-packages/prettytensor/local_trainer.py:126 in _create_initializers.: all_variables (from tensorflow.python.ops.variables) is deprecated and will be removed after 2016-03-02.
Instructions for updating:
Please use tf.global_variables instead.
WARNING:tensorflow:From /home/badami/Codes/deeplearning/tensorflow/local/lib/python2.7/site-packages/prettytensor/local_trainer.py:127 in _create_initializers.: initialize_all_variables (from tensorflow.python.ops.variables) is deprecated and will be removed after 2017-03-02.
Instructions for updating:
Use `tf.global_variables_initializer` instead.
WARNING:tensorflow:From /home/badami/Codes/deeplearning/tensorflow/local/lib/python2.7/site-packages/prettytensor/local_trainer.py:128 in _create_initializers.: initialize_local_variables (from tensorflow.python.ops.variables) is deprecated and will be removed after 2017-03-02.
Instructions for updating:
Use `tf.local_variables_initializer` instead.
WARNING:tensorflow:From /home/badami/Codes/deeplearning/tensorflow/local/lib/python2.7/site-packages/prettytensor/local_trainer.py:130 in _create_initializers.: all_variables (from tensorflow.python.ops.variables) is deprecated and will be removed after 2016-03-02.
Instructions for updating:
Please use tf.global_variables instead.
WARNING:tensorflow:From /home/badami/Codes/deeplearning/tensorflow/local/lib/python2.7/site-packages/prettytensor/local_trainer.py:122 in _create_initializers.: all_variables (from tensorflow.python.ops.variables) is deprecated and will be removed after 2016-03-02.
Instructions for updating:
Please use tf.global_variables instead.
WARNING:tensorflow:From /home/badami/Codes/deeplearning/tensorflow/local/lib/python2.7/site-packages/prettytensor/local_trainer.py:122 in _create_initializers.: all_variables (from tensorflow.python.ops.variables) is deprecated and will be removed after 2016-03-02.
Instructions for updating:
Please use tf.global_variables instead.
W tensorflow/core/framework/op_kernel.cc:975] Failed precondition: Attempting to use uninitialized value fully_connected/weights
[[Node: fully_connected/weights/read = Identity[T=DT_FLOAT, _class=["loc:@fully_connected/weights"], _device="/job:localhost/replica:0/task:0/cpu:0"](fully_connected/weights)]]
Exception -- stopping threads: Attempting to use uninitialized value fully_connected/weights
[[Node: fully_connected/weights/read = Identity[T=DT_FLOAT, _class=["loc:@fully_connected/weights"], _device="/job:localhost/replica:0/task:0/cpu:0"](fully_connected/weights)]]
Caused by op u'fully_connected/weights/read', defined at:
File "mnist_prettytensor.py", line 134, in <module>
tf.app.run()
File "/home/badami/Codes/deeplearning/tensorflow/local/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 43, in run
sys.exit(main(sys.argv[:1] + flags_passthrough))
File "mnist_prettytensor.py", line 84, in main
result = multilayer_fully_connected(image_placeholder, labels_placeholder)
File "mnist_prettytensor.py", line 54, in multilayer_fully_connected
return (images.flatten().fully_connected(100).fully_connected(100)
File "/home/badami/Codes/deeplearning/tensorflow/local/lib/python2.7/site-packages/prettytensor/pretty_tensor_class.py", line 1981, in method
result = func(non_seq_layer, *args, **kwargs)
File "/home/badami/Codes/deeplearning/tensorflow/local/lib/python2.7/site-packages/prettytensor/pretty_tensor_methods.py", line 355, in __call__
dt=dtype)
File "/home/badami/Codes/deeplearning/tensorflow/local/lib/python2.7/site-packages/prettytensor/pretty_tensor_class.py", line 1695, in variable
collections=variable_collections)
File "/home/badami/Codes/deeplearning/tensorflow/local/lib/python2.7/site-packages/tensorflow/python/ops/variable_scope.py", line 1024, in get_variable
custom_getter=custom_getter)
File "/home/badami/Codes/deeplearning/tensorflow/local/lib/python2.7/site-packages/tensorflow/python/ops/variable_scope.py", line 850, in get_variable
custom_getter=custom_getter)
File "/home/badami/Codes/deeplearning/tensorflow/local/lib/python2.7/site-packages/tensorflow/python/ops/variable_scope.py", line 346, in get_variable
validate_shape=validate_shape)
File "/home/badami/Codes/deeplearning/tensorflow/local/lib/python2.7/site-packages/tensorflow/python/ops/variable_scope.py", line 331, in _true_getter
caching_device=caching_device, validate_shape=validate_shape)
File "/home/badami/Codes/deeplearning/tensorflow/local/lib/python2.7/site-packages/tensorflow/python/ops/variable_scope.py", line 677, in _get_single_variable
expected_shape=shape)
File "/home/badami/Codes/deeplearning/tensorflow/local/lib/python2.7/site-packages/tensorflow/python/ops/variables.py", line 224, in __init__
expected_shape=expected_shape)
File "/home/badami/Codes/deeplearning/tensorflow/local/lib/python2.7/site-packages/tensorflow/python/ops/variables.py", line 370, in _init_from_args
self._snapshot = array_ops.identity(self._variable, name="read")
File "/home/badami/Codes/deeplearning/tensorflow/local/lib/python2.7/site-packages/tensorflow/python/ops/gen_array_ops.py", line 1424, in identity
result = _op_def_lib.apply_op("Identity", input=input, name=name)
File "/home/badami/Codes/deeplearning/tensorflow/local/lib/python2.7/site-packages/tensorflow/python/framework/op_def_library.py", line 759, in apply_op
op_def=op_def)
File "/home/badami/Codes/deeplearning/tensorflow/local/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 2240, in create_op
original_op=self._default_original_op, op_def=op_def)
File "/home/badami/Codes/deeplearning/tensorflow/local/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 1128, in __init__
self._traceback = _extract_stack()
FailedPreconditionError (see above for traceback): Attempting to use uninitialized value fully_connected/weights
[[Node: fully_connected/weights/read = Identity[T=DT_FLOAT, _class=["loc:@fully_connected/weights"], _device="/job:localhost/replica:0/task:0/cpu:0"](fully_connected/weights)]]
Traceback (most recent call last):
File "mnist_prettytensor.py", line 134, in <module>
tf.app.run()
File "/home/badami/Codes/deeplearning/tensorflow/local/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 43, in run
sys.exit(main(sys.argv[:1] + flags_passthrough))
File "mnist_prettytensor.py", line 123, in main
print_every=100)
File "/home/badami/Codes/deeplearning/tensorflow/local/lib/python2.7/site-packages/prettytensor/local_trainer.py", line 334, in train_model
print_every=print_every)[2:]
File "/home/badami/Codes/deeplearning/tensorflow/local/lib/python2.7/site-packages/prettytensor/local_trainer.py", line 286, in run_model
results = sess.run(ops, dict(zip(feed_vars, data)))
File "/home/badami/Codes/deeplearning/tensorflow/local/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 766, in run
run_metadata_ptr)
File "/home/badami/Codes/deeplearning/tensorflow/local/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 964, in _run
feed_dict_string, options, run_metadata)
File "/home/badami/Codes/deeplearning/tensorflow/local/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 1014, in _do_run
target_list, options, run_metadata)
File "/home/badami/Codes/deeplearning/tensorflow/local/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 1034, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.FailedPreconditionError: Attempting to use uninitialized value fully_connected/weights
[[Node: fully_connected/weights/read = Identity[T=DT_FLOAT, _class=["loc:@fully_connected/weights"], _device="/job:localhost/replica:0/task:0/cpu:0"](fully_connected/weights)]]
Caused by op u'fully_connected/weights/read', defined at:
File "mnist_prettytensor.py", line 134, in <module>
tf.app.run()
File "/home/badami/Codes/deeplearning/tensorflow/local/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 43, in run
sys.exit(main(sys.argv[:1] + flags_passthrough))
File "mnist_prettytensor.py", line 84, in main
result = multilayer_fully_connected(image_placeholder, labels_placeholder)
File "mnist_prettytensor.py", line 54, in multilayer_fully_connected
return (images.flatten().fully_connected(100).fully_connected(100)
File "/home/badami/Codes/deeplearning/tensorflow/local/lib/python2.7/site-packages/prettytensor/pretty_tensor_class.py", line 1981, in method
result = func(non_seq_layer, *args, **kwargs)
File "/home/badami/Codes/deeplearning/tensorflow/local/lib/python2.7/site-packages/prettytensor/pretty_tensor_methods.py", line 355, in __call__
dt=dtype)
File "/home/badami/Codes/deeplearning/tensorflow/local/lib/python2.7/site-packages/prettytensor/pretty_tensor_class.py", line 1695, in variable
collections=variable_collections)
File "/home/badami/Codes/deeplearning/tensorflow/local/lib/python2.7/site-packages/tensorflow/python/ops/variable_scope.py", line 1024, in get_variable
custom_getter=custom_getter)
File "/home/badami/Codes/deeplearning/tensorflow/local/lib/python2.7/site-packages/tensorflow/python/ops/variable_scope.py", line 850, in get_variable
custom_getter=custom_getter)
File "/home/badami/Codes/deeplearning/tensorflow/local/lib/python2.7/site-packages/tensorflow/python/ops/variable_scope.py", line 346, in get_variable
validate_shape=validate_shape)
File "/home/badami/Codes/deeplearning/tensorflow/local/lib/python2.7/site-packages/tensorflow/python/ops/variable_scope.py", line 331, in _true_getter
caching_device=caching_device, validate_shape=validate_shape)
File "/home/badami/Codes/deeplearning/tensorflow/local/lib/python2.7/site-packages/tensorflow/python/ops/variable_scope.py", line 677, in _get_single_variable
expected_shape=shape)
File "/home/badami/Codes/deeplearning/tensorflow/local/lib/python2.7/site-packages/tensorflow/python/ops/variables.py", line 224, in __init__
expected_shape=expected_shape)
File "/home/badami/Codes/deeplearning/tensorflow/local/lib/python2.7/site-packages/tensorflow/python/ops/variables.py", line 370, in _init_from_args
self._snapshot = array_ops.identity(self._variable, name="read")
File "/home/badami/Codes/deeplearning/tensorflow/local/lib/python2.7/site-packages/tensorflow/python/ops/gen_array_ops.py", line 1424, in identity
result = _op_def_lib.apply_op("Identity", input=input, name=name)
File "/home/badami/Codes/deeplearning/tensorflow/local/lib/python2.7/site-packages/tensorflow/python/framework/op_def_library.py", line 759, in apply_op
op_def=op_def)
File "/home/badami/Codes/deeplearning/tensorflow/local/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 2240, in create_op
original_op=self._default_original_op, op_def=op_def)
File "/home/badami/Codes/deeplearning/tensorflow/local/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 1128, in __init__
self._traceback = _extract_stack()
FailedPreconditionError (see above for traceback): Attempting to use uninitialized value fully_connected/weights
[[Node: fully_connected/weights/read = Identity[T=DT_FLOAT, _class=["loc:@fully_connected/weights"], _device="/job:localhost/replica:0/task:0/cpu:0"](fully_connected/weights)]]