bjascob / amrlib

A python library that makes AMR parsing, generation and visualization simple.
MIT License
216 stars 33 forks source link

Hi I encounter this issue: TypeError: nop() missing 1 required positional argument: 'it' #66

Closed ZhenFox closed 3 months ago

ZhenFox commented 4 months ago

When I run the spaCy extension part code (copied from your post), I encounter this issue: TypeError: nop() missing 1 required positional argument: 'it'

bjascob commented 4 months ago

Please provide the traceback.

ZhenFox commented 4 months ago
amrlib bug

The screenshot is attached. Thanks for your help!

bjascob commented 4 months ago

I don't know what's going on. This works fine for me and it's in the unit tests, so it gets checked every release. According to the traceback, the issue is with the 3rd party tqdm library. You could try commenting out the references to pbar (lines 61, 87 and 88). Removing the progress bar won't impact anything since it's probably in disabled mode anyway. What version of amrlib and tqdm are you using?

It also could be impacted by the @torch.no_grad() statement (line 20). You can try commenting that out too. That line is not required to run.

ZhenFox commented 4 months ago

amrlib is 0.7.1 and tqdm is 4.65.0. Is there any wrong with the version? Thank you so much for your help!

Sincerely

bjascob commented 4 months ago

You can try updating to the latest amrlib (v0.8.0), but the version you have should work fine.
You'll need to try commenting out code as I suggested above.

I'm guessing this is an issue with tqdm not working properly in whatever notebook environment you're using. You could run python from a bash prompt and try it there.

If this fixes it, I'd create a simple example of using tqdm outside of amrlib and post the issue to their github page.