Coder Social home page Coder Social logo

Comments (9)

wwjwhen avatar wwjwhen commented on July 19, 2024 3

@moezlinlin @mingchen62 @ritheshkumar95 OK, I know how to solve the problem, to replace FreeRunIm2LatexAttention with im2latexAttention, it seems that the attention function is mis-used

from im2latex-tensorflow.

ritheshkumar95 avatar ritheshkumar95 commented on July 19, 2024 1

@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.

from im2latex-tensorflow.

ritheshkumar95 avatar ritheshkumar95 commented on July 19, 2024

I already had this code. i forget to push it,

Check if it works now and let me know,

from im2latex-tensorflow.

mingchen62 avatar mingchen62 commented on July 19, 2024

from im2latex-tensorflow.

moezlinlin avatar moezlinlin commented on July 19, 2024

when I run "python attention.py"
I met the same problem, could you tell me how to solve it?
thank you very much! ! !

Traceback (most recent call last):
File "attention.py", line 37, in
out,state = tflib.ops.FreeRunIm2LatexAttention('AttLSTM',emb_seqs,ctx,EMB_DIM,ENC_DIM,DEC_DIM,D,H,W)
File "/home/wll/im2latex/im2latex0123/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 1336, 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 5694, in transpose
"Transpose", x=x, perm=perm, name=name)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/op_def_library.py", line 787, in _apply_op_helper
op_def=op_def)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 2958, in create_op
set_shapes_for_outputs(ret)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 2209, in set_shapes_for_outputs
shapes = shape_func(op)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 2159, 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 627, in call_cpp_shape_fn
require_shape_fn)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/common_shapes.py", line 691, 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].

from im2latex-tensorflow.

wwjwhen avatar wwjwhen commented on July 19, 2024

I meet the same problem, and after going through the codes, I find that the def FreeRunIm2LatexAttention( name, ctx, input_dim, output_dim, ENC_DIM, DEC_DIM, D, H, W ): in tflib\ops.py accepts ctx after name but in attention.py, the function accepts emb_seqs rather than out,state = tflib.ops.FreeRunIm2LatexAttention('AttLSTM',emb_seqs,ctx,EMB_DIM,ENC_DIM,DEC_DIM,D,H,W), I think the problem has no relations with TF version, but a syntax error, yet I don not know how to fix it :(

from im2latex-tensorflow.

vuthithao avatar vuthithao commented on July 19, 2024

@wwjwhen When I replace FreeRunIm2LatexAttention with im2latexAttention I have some wrong bellow:
InvalidArgumentError (see above for traceback): assertion failed: [Expected shape for Tensor rnn/sequence_length:0 is ] [20] [ but saw shape: ] [8]
[[node rnn/Assert/Assert (defined at /root/im2latex-tensorflow/tflib/ops.py:533) = Assert[T=[DT_STRING, DT_INT32, DT_STRING, DT_INT32], summarize=3, _device="/job:localhost/replica:0/task:0/device:CPU:0"](rnn/All/_99, rnn/Assert/Assert/data_0, rnn/stack/_101, rnn/Assert/Assert/data_2, rnn/Shape_1/_103)]]
[[{{node rnn/while/PyFunc/_278}} = _Recvclient_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device_incarnation=1, tensor_name="edge_2593_rnn/while/PyFunc", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:GPU:0"]]

Can you help me, please?

from im2latex-tensorflow.

arieshx avatar arieshx commented on July 19, 2024

@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.

You this sucker!!!!!

from im2latex-tensorflow.

ritheshkumar95 avatar ritheshkumar95 commented on July 19, 2024

@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.

You this sucker!!!!!

Reporting and blocking this user for bad language.

from im2latex-tensorflow.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.