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

Add missing kwargs to _init_optims and _init_losses #27

Merged
merged 1 commit into from Dec 4, 2018

Conversation

Projects
None yet
2 participants
@mtngld
Contributor

mtngld commented Dec 4, 2018

Great package!

I noticed a small bug when trying to run VADA:

$ python scripts/train_digits.py --log ./log --vada --source svhn --target mnist --epochs 10 --gpu 3
Start Experiments
Normalize data
Using downloaded and verified file: /tmp/data/train_32x32.mat
Normalize data
Normalize data
Using downloaded and verified file: /tmp/data/train_32x32.mat
Normalize data
Registered DigitModel as "classifier"
Registered Linear as "discriminator"
Traceback (most recent call last):
  File "scripts/train_digits.py", line 112, in <module>
    experiment = solver.VADASolver(model, disc, loader_plain, **kwargs)
  File "/mnt/matang/salad/salad/solver/da/dirtt.py", line 84, in __init__
    super(VADASolver, self).__init__(model, discriminator, dataset, *args, **kwargs)
  File "/mnt/matang/salad/salad/solver/da/dann.py", line 83, in __init__
    super().__init__(model, dataset, *args, **kwargs)
  File "/mnt/matang/salad/salad/solver/da/base.py", line 49, in __init__
    super(DABaseSolver, self).__init__(*args, **kwargs)
  File "/mnt/matang/salad/salad/solver/classification.py", line 80, in __init__
    super().__init__(dataset=dataset, *args, **kwargs)
  File "/mnt/matang/salad/salad/solver/base.py", line 201, in __init__
    StructuredInit.__init__(self, **kwargs)
  File "/mnt/matang/salad/salad/solver/base.py", line 49, in __init__
    self._init_losses(**kwargs)
TypeError: _init_losses() got an unexpected keyword argument 'learningrate'

By making the suggested change, I can run VADA succesfully.

Thanks.

@stes stes self-assigned this Dec 4, 2018

@stes

stes approved these changes Dec 4, 2018

Thanks for contributing this PR!
To add some background, I think this error was introduced when I added the **kwargs in the Solver super class (that's why the error should currently not occur in the pip package).

@stes stes merged commit ba7abe1 into domainadaptation:master Dec 4, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment