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

TypeError: NoTrainInceptionV3.__init__() takes 1 positional argument but 4 were given #2130

Closed
segalinc opened this issue Oct 2, 2023 · 4 comments · Fixed by #2143
Closed
Labels
bug / fix Something isn't working help wanted Extra attention is needed v1.1.x v1.2.x

Comments

@segalinc
Copy link

segalinc commented Oct 2, 2023

Hello,

trying to init NoTrainInceptionV3 with latest version

    feature_list=["2048"]
    inception = NoTrainInceptionV3(name="inception-v3-compat", features_list=feature_list)

but I get

   445     raise TypeError("{}.__init__() got an unexpected keyword argument '{}'"
    446                     "".format(type(self).__name__, next(iter(kwargs))))
    448 if self.call_super_init is False and bool(args):
--> 449     raise TypeError("{}.__init__() takes 1 positional argument but {} were"
    450                     " given".format(type(self).__name__, len(args) + 1))
    452 """
    453 Calls super().__setattr__('a', a) instead of the typical self.a = a
    454 to avoid Module.__setattr__ overhead. Module's __setattr__ has special
    455 handling for parameters, submodules, and buffers but simply calls into
    456 super().__setattr__ for all other attributes.
    457 """
    458 super().__setattr__('training', True)

TypeError: NoTrainInceptionV3.__init__() takes 1 positional argument but 4 were given

@segalinc segalinc added bug / fix Something isn't working help wanted Extra attention is needed labels Oct 2, 2023
@Borda Borda changed the title TypeError: NoTrainInceptionV3.__init__() takes 1 positional argument but 4 were given TypeError: NoTrainInceptionV3.__init__() takes 1 positional argument but 4 were given Oct 2, 2023
@Borda
Copy link
Member

Borda commented Oct 2, 2023

@segalinc could you pls chare more details like what package versions you are using?

@segalinc
Copy link
Author

segalinc commented Oct 2, 2023

torchmetrics @ git+https://github.com/Lightning-AI/torchmetrics.git@0d7d6c7ccfedbb4941dfc55e65bbfca88506b2dc

I also tried with version 1.1.12 and 1.2.0

I am using python not conda

@SkafteNicki
Copy link
Member

I assume it's because you do not have torch-fidelity installed and it therefore is a dummy class that is trying to be initialized which does only take one argument.
@segalinc could you please confirm if this is true?
@Borda we should probably guard against this in some way

@segalinc
Copy link
Author

segalinc commented Oct 3, 2023

Yes installing torch-fidelity solved the problem
Maybe adding this note in the readme.md or as requirements can help
thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug / fix Something isn't working help wanted Extra attention is needed v1.1.x v1.2.x
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants