question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Parser in e2e_asr_transducer is missing a return statment

See original GitHub issue

In the code: https://github.com/espnet/espnet/blob/master/espnet/nets/pytorch_backend/e2e_asr_transducer.py

You’re not returning parser in add_arguments. This throws an error when attempting to call E2E.build()

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
thethinycommented, Nov 6, 2019

Thank you for the PR that fixes the issue. I read your explanation and came to understanding of your point. What you’re doing is passing a parser object by reference to the add_argument function, which is working well for you. However, in your code /path/to/utils/fill_missing_args.py you’re assuming that parser is returned, since you’re calling parse_known_args() on the execution of the function, therefore failing in this case. Another solution can be introduced which is to change the line default_args, _ = add_arguments(argparse.ArgumentParser()).parse_known_args() into separate lines as so:

parser = argparse.ArgumentParser()
add_arguments(parser)
default_args, _ = parser.parse_known_args()

Regards,

0reactions
ahmedalbahnasawycommented, Nov 6, 2019

Thanks for taking the time to review my issue. The issue arises when trying to import E2E asr_transducer, then using the command E2E.build(). The error occurs when the line default_args, _ = add_arguments(argparse.ArgumentParser()).parse_known_args() is executed in the file (...)/espnet/utils/fill_missing_args.py. Using the available train and eval files will not yield that error, but creating a new python file with the correct imports will create the error: NoneType Object does not have attribute parse_known_args()

Read more comments on GitHub >

github_iconTop Results From Across the Web

JavaCC - Missing Return Statement Exception - Stack Overflow
In the generated parser file, this method throws a missing return statement exception, although I find the return statement is always ...
Read more >
Java Missing Return Statement - Baeldung
The missing return statement error is a compile-time error.​​ The main causes are: a return statement was simply omitted by mistake. the method ......
Read more >
Missing Return Statement Required return type string
I am a beginner, I wrote this code to basically take two JSON POSTS and combine them I am getting a Save Error:...
Read more >
[Solved] Missing return statement in java error
1. Method missing the return statement. public class HelloWorld { public static ...
Read more >
Java missing return statement - Javatpoint
The missing return statement is one of the most occurred errors in the Java program. The beginners usually face the missing return statement...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found