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

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

Open
vegetableclean opened this issue Nov 15, 2023 · 3 comments
Open

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

vegetableclean opened this issue Nov 15, 2023 · 3 comments

Comments

@vegetableclean
Copy link

vegetableclean commented Nov 15, 2023

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
@shahaffind
Copy link
Collaborator

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

@vegetableclean
Copy link
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.

@shahaffind
Copy link
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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants