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

Can't instantiate abstract class TopKAccuracy with abstract methods reset #1

Open
azyslzp opened this issue Sep 16, 2020 · 2 comments

Comments

@azyslzp
Copy link

azyslzp commented Sep 16, 2020

In the debug of train.py. I met a problem, that is when I run

Metrics

top3 = TopKAccuracy(k=3)
top5 = TopKAccuracy(k=5)
metrics = ["acc", top3, top5]
it comes from
class TopKAccuracy(EpochMetric):
def init(self, k: int):
super(TopKAccuracy, self).init()
self.k = k
self.acc = None
self.name = "top_{}_accuracy".format(self.k)
self.register_buffer("_accuracy", None)
....
but it output TypeError: Can't instantiate abstract class TopKAccuracy with abstract methods reset

@isaaccorley
Copy link
Owner

Fixed #2

@azyslzp
Copy link
Author

azyslzp commented Sep 17, 2020

Fixed #2

Thanks a lot! I have also solved the problem by comment the
@AbstractMethod

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