Skip to content

AttributeError: 'Parameter' object has no attribute 'hess' #5

@samiit

Description

@samiit

Hi David,

Thanks for this repo. I tried it as an optimizer on toy examples and it worked fine but am struggling to make it work for an object detection case. Specifically, I am trying to use this as an optimizer for Yolo v5 from Ultralytics.

When I updated the train.py file there, I am facing some issues at the time of training. It uses a scheduler and I was wondering whether this is the source of the problem.
Here is part of the error log:

 File "train.py", line 309, in train
    optimizer.step()
  File "/usr/local/lib/python3.6/dist-packages/torch/optim/lr_scheduler.py", line 67, in wrapper
    return wrapped(*args, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/torch/autograd/grad_mode.py", line 26, in decorate_context
    return func(*args, **kwargs)
  File "/yolov5/ada_hessian.py", line 100, in step
    self.zero_hessian()
  File "/yolov5/ada_hessian.py", line 59, in zero_hessian
    if not isinstance(p.hess, float) and self.state[p]["hessian step"] % self.update_each == 0:
AttributeError: 'Parameter' object has no attribute 'hess'

Do you have any suggestions?

Regards,
Sam

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions