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

Bug after the latest commit #63 #87

Closed
JizeZhangCS opened this issue Jun 11, 2023 · 1 comment
Closed

Bug after the latest commit #63 #87

JizeZhangCS opened this issue Jun 11, 2023 · 1 comment

Comments

@JizeZhangCS
Copy link

Phenomenon

layers.py, line 269,

  File "/storage_fast/jzzhang/loralib/layers.py", line 308, in __init__
    super(Conv2d, self).__init__(nn.Conv2d, *args, **kwargs)
  File "/storage_fast/jzzhang/loralib/layers.py", line 269, in __init__
    self.conv.weight.new_zeros((out_channels//self.groups*kernel_size, r*kernel_size))
  File "/storage/jzzhang/miniconda3/envs/lora/lib/python3.8/site-packages/torch/nn/modules/module.py", line 947, in __getattr__
    raise AttributeError("'{}' object has no attribute '{}'".format(
AttributeError: 'Conv2d' object has no attribute 'groups'

Analysis

In the latest commit, the change in line 257 make lora.Conv2d has no more inheritance from nn.Conv2d, but instead nn.Modules, which havn't a attribute called groups.

Possible Solution

change line 269 to
self.conv.weight.new_zeros((out_channels//self.conv.groups*kernel_size, r*kernel_size))

@edwardjhu
Copy link
Collaborator

Thanks! I fixed it.

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