-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Difficulty in instantiating TensorTrain from tt_cores #113
Comments
So you want the output of your model to be a tensor train object, right?
Can you do it by TensorTrain(ouput_of_your_model), where ouput_of_your_model
is a list of the tensors of appropriate sizes?
If your model returns you just a bunch of numbers you can slice them into
chunks and reshape into TT-cores. E.g.
original_output = tf.random_normal((100))
tt_cores[0] = tf.reshape(original_output[0:6], (1, 3, 2))
tt_cores[1] = tf.reshape(original_output[6:30], (2, 3, 4))
...
ср, 28 февр. 2018 г., 17:27 Austen Lamacraft <notifications@github.com>:
… I have the following problem that I don't know how to get around... would
really appreciate any advice.
I want to form model inputs into TT cores and use them to instantiate a
TensorTrain (I can't do to_tt_tensor because the number of inputs is too
large -- the full tensor would be huge)
However, since TensorTrain does tt_cores = list(tt_cores), I get the
(Tensorflow) error
TypeError: `Tensor` objects are not iterable when eager execution is not enabled. To iterate over this tensor use `tf.map_fn`.
(tf.map_fn doesn't solve the problem, of course). Eager execution doesn't
work at present:
import tensorflow as tf
import tensorflow.contrib.eager as tfe
import t3f
tfe.enable_eager_execution()
shape = (3, 4, 4, 5, 7, 5)
initialization = t3f.random_tensor(shape, tt_rank=5)
estimated = t3f.get_variable('estimated', initializer=initialization)
yielding
ValueError: ValueError: Variable estimated does not exist, or was not created with t3f.get_tt_variable(). Did you mean to set reuse=None in VarScope?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#113>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AFXq6ZNZiecwhajFIMvjhJCIn1SX9vFRks5tZT9BgaJpZM4SWiXX>
.
|
Thanks, that works. I was using a tfe.Iterator to get data, which produces Tensors, but I guess there's no need. On the other hand, it would be great if t3f would work in eager mode. Do you have any idea how hard it is? I'd be happy to give it a try... |
Hm, I'll take a look, thanks for the request. |
It seems that a hacky solution is to change |
It seems that the problem is that if eager mode is enabled then reuse is always true, so the code tries to find the TensorTrainVariables collection and crashes. I tried to fix it as in the tensorflow code, e.g. |
|
Hi, for I can only use cuda 8.0, and install tensorflow below 1.5.0. How I can solve this problem? please help me. |
I have the following problem that I don't know how to get around... would really appreciate any advice.
I want to form model inputs into TT cores and use them to instantiate a
TensorTrain
(I can't doto_tt_tensor
because the number of inputs is too large -- the full tensor would be huge)However, since
TensorTrain
doestt_cores = list(tt_cores)
, I get the (Tensorflow) error(
tf.map_fn
doesn't solve the problem, of course). Eager execution doesn't work at present:yielding
The text was updated successfully, but these errors were encountered: