Zj-BinXia / SSL

This project is the official implementation of 'Structured Sparsity Learning for Efficient Video Super-Resolution', CVPR2023
95 stars 6 forks source link

Code confusion 3 #7

Closed zxd-cqu closed 1 year ago

zxd-cqu commented 1 year ago
    def optimize_parameters(self, current_iter):
        if self.fix_flow_iter:
            if current_iter == 1:
                self.logger.info(f'Fix flow network and feature extractor for {self.fix_flow_iter} iters.')
                for name, param in self.model.named_parameters():
                    if 'spynet' in name or 'edvr' in name:
                        param.requires_grad_(False)
            # elif current_iter == self.fix_flow_iter:
            #     self.logger.warning('Train all the parameters.')
            #     self.model.requires_grad_(True)

Hi, should this code snippet (in SSL-master/basicsr/pruner/SSL_pruner.py) be uncommented, otherwise the flow network will never be trained?

Zj-BinXia commented 1 year ago

I don't intend to prune the optical flow network (Spynet) in my network, so I intentionally commented it out.

Zj-BinXia commented 1 year ago

The structure of the optical flow network is complex, and pruning it would make the pruning strategy very complicated. Additionally, I believe that exploring the pruning strategy for the optical flow network together would make the problem excessively complex.

zxd-cqu commented 1 year ago

Got it. Thank you for your response.