Bug in JointAutoregressiveHierarchicalPriors._compress_ar
See original GitHub issuehttps://github.com/InterDigitalInc/CompressAI/blob/master/compressai/models/priors.py
In JointAutoregressiveHierarchicalPriors._compress_ar:
ctx_p = F.conv2d( y_crop, self.context_prediction.weight, bias=self.context_prediction.bias )
self.context_prediction.weight ignores the mask, leading to the context mismatch between _compress_ar and _decompress_ar.
y_hat in _compress_ar is the full feature and needs to be masked.
Solution:
masked_weight = self.context_prediction.weight * self.context_prediction.mask
ctx_p = F.conv2d( y_crop, masked_weight, bias=self.context_prediction.bias )
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (5 by maintainers)
Top Results From Across the Web
[1809.02736] Joint Autoregressive and Hierarchical Priors for ...
Abstract: Recent models for learned image compression are based on autoencoders, learning approximately invertible mappings from pixels to a ...
Read more >A PyTorch library and evaluation platform for end-to-end ...
Bug in JointAutoregressiveHierarchicalPriors._compress_ar ... Bug. Hello, I built a video compressor with Compressai.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks for the code, I managed to re-create the bug! What’s happening is you are saving your model before evaluating it, so the weights have been overwritten by the optimizer. I’ll apply a fix with your earlier proposal. Thanks for reporting this!
I hope the information helps. It is not a big problem for the program anyway.