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

ConvXd -> QuantConvXd fails when padding='same' #1016

Closed
nickfraser opened this issue Aug 29, 2024 · 1 comment
Closed

ConvXd -> QuantConvXd fails when padding='same' #1016

nickfraser opened this issue Aug 29, 2024 · 1 comment
Assignees
Labels
bug Something isn't working next release PRs which should be merged for the next release nn Anything related to nn modules

Comments

@nickfraser
Copy link
Collaborator

Simple repro:

import torch
import torch.nn as nn

from brevitas.graph.quantize import preprocess_for_quantize
from brevitas.graph.quantize import quantize

model = nn.Sequential(
    nn.Conv2d(2,3,kernel_size=3,padding='same')
)

print(type(model._modules['0'].stride))
gmodel = preprocess_for_quantize(model)
qmodel = quantize(gmodel)

with the following error message:

File "c:\cygwin64\home\nfraser\workspace\brevitas\src\brevitas\nn\quant_conv.py", line 135, in __init__
    if padding_mode == 'zeros' and padding == 'same' and stride > 1:
TypeError: '>' not supported between instances of 'tuple' and 'int'
@nickfraser nickfraser self-assigned this Aug 29, 2024
@nickfraser nickfraser added next release PRs which should be merged for the next release bug Something isn't working nn Anything related to nn modules labels Aug 29, 2024
@nickfraser
Copy link
Collaborator Author

Fixed in #1017.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working next release PRs which should be merged for the next release nn Anything related to nn modules
Projects
None yet
Development

No branches or pull requests

1 participant