You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm currently trying to use tf.contrib.learn.read_batch_examples working while using a TensorFlow (SKFlow/tf.contrib) Estimator, specifically the LinearClassifier. I create a read_batch_examples op feeding in a CSV file with a tf.decode_csv for the parse_fn parameter with appropriate default records. I then feed that op to my input_fn for fitting the Estimator, but when that's run I receive the following error:
Error Message
ValueError: Tensor("centered_bias_weight:0", shape=(1,), dtype=float32_ref) must be from the same graph as Tensor("linear/linear/BiasAdd:0", shape=(?, 1), dtype=float32).
What I've Tried
The code works if I run the op beforehand and then feed the input instead as an array of values. While this workaround exists, it is unhelpful because I am working with large datasets in which I need to batch in my inputs. Currently going over Estimator.fit (currently equivalent to Estimator.partial_fit in iterations isn't nearly as fast as being able to feed in data as it trains, so having this working is ideal. Additionally I've tried wrapping everything with with tf.Graph().asdefault(). Any ideas? The non-functioning code is below.
Oh I feel like an idiot! I've been creating the op outside of the graph scope. It works now, can't believe I didn't think to try that. Thanks a lot! This is a non-issue and has been resolved.
Environment info
Operating System: Ubuntu
Package: https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.10.0rc0-cp27-none-linux_x86_64.whl
Version: 0.10.0rc0
I'm currently trying to use
tf.contrib.learn.read_batch_examples
working while using a TensorFlow (SKFlow/tf.contrib) Estimator, specifically theLinearClassifier
. I create aread_batch_examples
op feeding in a CSV file with atf.decode_csv
for theparse_fn
parameter with appropriate default records. I then feed that op to myinput_fn
for fitting the Estimator, but when that's run I receive the following error:Error Message
What I've Tried
The code works if I run the op beforehand and then feed the input instead as an array of values. While this workaround exists, it is unhelpful because I am working with large datasets in which I need to batch in my inputs. Currently going over
Estimator.fit
(currently equivalent toEstimator.partial_fit
in iterations isn't nearly as fast as being able to feed in data as it trains, so having this working is ideal. Additionally I've tried wrapping everything withwith tf.Graph().asdefault()
. Any ideas? The non-functioning code is below.Shortened Source Code to Reproduce
read_batch_examples_fails_with_estimator.txt
Any alternatives for batching would be appreciated as well!
The text was updated successfully, but these errors were encountered: