-
Notifications
You must be signed in to change notification settings - Fork 76
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
output the whole sequence within TF #15
Comments
I already had this code. i forget to push it, Check if it works now and let me know, |
thanks much for the quick fix.
I just tried the latest code from github and got this error:
$ python attention.py
WARNING (theano.tensor.blas): Using NumPy C-API based implementation for
BLAS functions.
Traceback (most recent call last):
File "attention.py", line 38, in <module>
out,state =
tflib.ops.FreeRunIm2LatexAttention('AttLSTM',emb_seqs,ctx,EMB_DIM,ENC_DIM,DEC_DIM,D,H,W)
File "/home/mc/im2latex-tensorflow/tflib/ops.py", line 625, in
FreeRunIm2LatexAttention
V = tf.transpose(ctx,[0,2,3,1]) # (B, H, W, D)
File
"/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/array_ops.py",
line 1285, in transpose
ret = gen_array_ops.transpose(a, perm, name=name)
File
"/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/gen_array_ops.py",
line 3658, in transpose
result = _op_def_lib.apply_op("Transpose", x=x, perm=perm, name=name)
File
"/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/op_def_library.py",
line 767, in apply_op
op_def=op_def)
File
"/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py",
line 2508, in create_op
set_shapes_for_outputs(ret)
File
"/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py",
line 1873, in set_shapes_for_outputs
shapes = shape_func(op)
File
"/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py",
line 1823, in call_with_requiring
return call_cpp_shape_fn(op, require_shape_fn=True)
File
"/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/common_shapes.py",
line 610, in call_cpp_shape_fn
debug_python_shape_fn, require_shape_fn)
File
"/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/common_shapes.py",
line 676, in _call_cpp_shape_fn_impl
raise ValueError(err.message)
ValueError: Dimension must be 3 but is 4 for 'transpose' (op: 'Transpose')
with input shapes: [?,?,80], [4]
…On Fri, Oct 20, 2017 at 6:22 PM, Rithesh Kumar ***@***.***> wrote:
I already had this code. i forget to push it,
Check if it works now and let me know,
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#15 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AHKK6G61wtEqrOJwgT5uT-UJFFAPqA4dks5suR0YgaJpZM4QA4DJ>
.
|
when I run "python attention.py" Traceback (most recent call last): |
@moezlinlin @mingchen62 I'm sorry i'm quite busy, i don't get the time to fix bugs everytime tensorflow updates the version. Please try fixing it yourself, i'm happy to accept your pull requests. |
I meet the same problem, and after going through the codes, I find that the |
@moezlinlin @mingchen62 @ritheshkumar95 OK, I know how to solve the problem, to replace |
@wwjwhen When I replace FreeRunIm2LatexAttention with im2latexAttention I have some wrong bellow: Can you help me, please? |
You this sucker!!!!! |
Reporting and blocking this user for bad language. |
thanks much for the excellent code.
in the current predict, i saw it gets output idx one by one:
(Maybe it is for visualization purpose).
attention.py: line 86
for i in xrange(1,160):
inp_seqs[:,i] = sess.run(predictions,feed_dict={X:imgs,input_seqs:inp_seqs[:,:i]})
In my test, it takes quite a while on my GPU machine. My understanding is it goes back and forth between TF and Python.
Would it be more efficient to have one TF OP to output the whole sequence? I would be happy to work on it if there is some guidance?
The text was updated successfully, but these errors were encountered: