Skip to content
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

notebooks are broken #98

Open
volkancirik opened this issue Feb 16, 2021 · 7 comments
Open

notebooks are broken #98

volkancirik opened this issue Feb 16, 2021 · 7 comments

Comments

@volkancirik
Copy link

CTC, CTC_with_padding, and Unsupervised_CFG notebooks are not working. in sparse.py L591 too many values to unpack for CTCs and no module named torch_struct.networks for CFG.

@srush
Copy link
Collaborator

srush commented Feb 16, 2021

Oh thanks for the heads up. I will update these and figure out how to test them.

Do you need a particular example in the short term? I can prioritize what you are looking for.

@volkancirik
Copy link
Author

Thanks for the prompt response! any chance of having a notebook with Semi-Markov or Alignment models?

@srush
Copy link
Collaborator

srush commented Feb 16, 2021

Sure. I will do that. I might switch to just files though as notebooks are hard to keep current.

If you are looking for demos, you might find the docs helpful as well http://nlp.seas.harvard.edu/pytorch-struct/model.html#Semi-Markov

@volkancirik
Copy link
Author

thanks for the pointer!

@volkancirik
Copy link
Author

this works but super slow. I tried to use cuda instead.

log_potentials = torch.rand(batch, N, M, 3)
dist = AlignmentCRF(log_potentials)
show_deps(dist.argmax[0])

this fails:

log_potentials = torch.rand(batch, N, M, 3).cuda()

~/bin/anaconda2/envs/torchstruct/lib/python3.7/site-packages/genbmm/sparse.py in forward(ctx, a, a_lu, a_ld, b, b_lu, b_ld, o_lu, o_ld)
589
590 _, indices2 = _genbmm.forward_band(
--> 591 bt.data.contiguous(), bt.lu, bt.ld, at.data.contiguous(), at.lu, at.ld, 1
592 )
593
ValueError: too many values to unpack (expected 2)

@srush
Copy link
Collaborator

srush commented Feb 16, 2021

I'll take a look. Are you on CPU or GPU? The alignment code only really runs on GPU (if you want CPU there are much better libraries).

@volkancirik
Copy link
Author

I'm on GPU. SemiMarkovCRF works fine but too many values to unpack error is still there for the alignment model.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants