Skip to content

"RuntimeError: invalid unordered_map<K, T> key" #1

Open

Description

@vegetableclean

Hi, thanks for you paper, it is very exciting.
But, may I have a question, when I tried to implementation your WCC function to replace conv1x1, It occurs this:
"RuntimeError: invalid unordered_map<K, T> key"
Do you have any ides? Thanks!

Here is my code:

class DepthwiseSeparableConv(nn.Module):
def init(self, in_channels, out_channels, kernel_size, stride=1, padding=0, levels=3, compress_rate=0.5, bit_w=4, bit_a=4):
super(DepthwiseSeparableConv, self).init()
self.depthwise = nn.Conv2d(in_channels, in_channels, kernel_size, stride, padding, groups=in_channels, bias=False)
self.pointwise = WCC(in_channels,
out_channels,
1, # stride 為 1
0, # padding 為 0
1, # dilation 為 1
1, # groups 為 1
False, # bias 為 False
levels,
compress_rate,
bit_w,
bit_a
) # 正確地傳遞 wavelet_name 參數

def forward(self, x):
    x = self.depthwise(x)
    x = self.pointwise(x)
    return x

Activity

  1. shahaffind commented on Nov 21, 2023

    @shahaffind
    Collaborator

    Hi, thank you for your interest in our work :)
    Can you provide the entire error message?

  2. vegetableclean commented on Nov 22, 2023

    @vegetableclean
    Author

    Hello, I solved the problem last week, and it seemed to be an issue with the dimension settings. Nonetheless, I appreciate your response. If you don't mind, may I ask if you have applied your model to a transformer? I'm interested in trying your method with a transformer architecture for super resolution. However, I'm unsure if it's feasible, as in your paper, you used a CNN architecture and replaced all the con3x3. I plan to replace all conv3x3 in my transformer model while keeping the rest unchanged. I'm not sure if this approach might pose any issues.

  3. shahaffind commented on Nov 22, 2023

    @shahaffind
    Collaborator

    First, we replaced the 1x1 and not 3x3 (I assume this was a typo, but I'm just making sure).
    Second, we didn't test the method with transformers, but it may work as long as the tokens have similar properties to CNN's feature maps (e.g. relatively smooth 2D representation similar to natural images, which allows the compression)

    It should be fairly easy to adopt. You probably only need to reshape the 1D token tensors to 2D before using the WCC layer.

    I hope this will go well. Keep me posted on the results 😄

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions