question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bug in JointAutoregressiveHierarchicalPriors._compress_ar

See original GitHub issue

https://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:closed
  • Created 3 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
jbegaintcommented, Jan 29, 2021

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!

1reaction
BYchao100commented, Jan 29, 2021

I hope the information helps. It is not a big problem for the program anyway.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found