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.

Suddenly failing tests with a NotImplementedError

See original GitHub issue

🐛 Bug description

Getting a strange bug in recent commits to nussl with the latest ignite version. They look like this:

tests/separation/test_deep.py:62: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
nussl/ml/train/trainer.py:300: in add_stdout_handler
    pause=ValidationEvents.VALIDATION_COMPLETED
/opt/hostedtoolcache/Python/3.6.10/x64/lib/python3.6/site-packages/ignite/handlers/timing.py:115: in attach
    engine.add_event_handler(pause, self.pause)
/opt/hostedtoolcache/Python/3.6.10/x64/lib/python3.6/site-packages/ignite/engine/engine.py:269: in add_event_handler
    if event_name not in self._allowed_events:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <Events.EPOCH_STARTED: 'epoch_started'>
other = <ValidationEvents.VALIDATION_COMPLETED: 'validation_completed'>

    def __eq__(self, other):
        if isinstance(other, CallableEventWithFilter):
            return self.name == other.name
        elif isinstance(other, str):
            return self.name == other
        else:
>           raise NotImplementedError
E           NotImplementedError

The full log is here:

https://github.com/nussl/nussl/runs/827399639

Did something in the Events API change? This worked in ignite 0.3 no problem.

Thanks!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
vfdev-5commented, Jul 1, 2020

@sdesrozis you can be faster in doc fix 😃 Migration note is done.

1reaction
sdesroziscommented, Jul 1, 2020

@pseeth

Your custom events are defined inheriting Enum. For now, you have to inherit from EventEnum (seen here https://github.com/nussl/nussl/blob/2c45df2ca4ba38db643f9f3903cee229b9ac301c/nussl/ml/train/trainer.py#L19).

Have a look here https://github.com/pytorch/ignite#custom-events-to-go-beyond-standard-events

HTH

EDIT : @vfdev-5 too fast 😂

Read more comments on GitHub >

github_iconTop Results From Across the Web

python - pytest in VS Code: Point out test failures because of ...
Now I would like to have a better overview of why tests are failing - NotImplementedError or an "actual" exception. Can this be...
Read more >
Cannot convert a symbolic Tensor (strided_slice:0) to a numpy ...
NotImplementedError: Cannot convert a symbolic Tensor (cond_2/strided_slice:0) to a numpy array. if I use numpy 1.19.5 I get
Read more >
NotImplementedError: Cannot convert a symbolic Tensor ...
Hi @Tioz,. Assuming your code and environment hasn't changed, it is almost impossible to have code that was working suddenly fail to work....
Read more >
How to write 'helloworld'-level unit tests? : r/learnpython - Reddit
Of course, TDD specifies that you need to first have a failing test. So my sample will fail, expectedly. Then you can fix...
Read more >
Issue 1466: Special reporting of NotImplementedError in unittest
When a unittest test case raises an Exception, that test case is considered a failure. However, raising NotImplementedError is not a failure ......
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