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

Optimizer type <class '__main__.HessianFree'> not supported by higher yet. #2

Open
jaytimbadia opened this issue Mar 16, 2022 · 0 comments

Comments

@jaytimbadia
Copy link

Hi,

I am trying this Hessian free optimization but it seems that I am not able to do as its throwing error saying -

Optimizer type <class 'main.HessianFree'> not supported by higher yet.

ValueError: Optimizer type <class '__main__.HessianFree'> not supported by higher yet.
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
/tmp/ipykernel_41276/2741193226.py in <module>
      9 train_loader = torch.utils.data.DataLoader(train, batch_size=4, shuffle=False)
     10 
---> 11 with higher.innerloop_ctx(model, opti, track_higher_grads=False) as (fmodel, diffopt):
     12     for xs, ys in train_loader:
     13         logits = fmodel(xs)

/usr/lib/python3.8/contextlib.py in __enter__(self)
    111         del self.args, self.kwds, self.func
    112         try:
--> 113             return next(self.gen)
    114         except StopIteration:
    115             raise RuntimeError("generator didn't yield") from None

~/Desktop/Glacier/luck/lib/python3.8/site-packages/higher/__init__.py in innerloop_ctx(model, opt, device, copy_initial_weights, override, track_higher_grads)
     89         track_higher_grads=track_higher_grads
     90     )
---> 91     diffopt = optim.get_diff_optim(
     92         opt,
     93         model.parameters(),

~/Desktop/Glacier/luck/lib/python3.8/site-packages/higher/optim.py in get_diff_optim(opt, reference_params, fmodel, device, override, track_higher_grads, **kwargs)
    780         )
    781     else:
--> 782         raise ValueError(
    783             "Optimizer type {} not supported by higher yet.".format(type(opt))
    784         )

ValueError: Optimizer type <class '__main__.HessianFree'> not supported by higher yet.

Please Help!

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

1 participant