Closed Lohit106 closed 3 months ago
Hi @Lohit106, the Maxpool operator is partially supported in auto_LiRPA, conditioned on strides==kernel_size. The most convenient fix for the issue will be to use a model which only consists of supported operators. You can modify the network to have strides==kernel_size for all the Maxpool layers.
Hi @shizhouxing, thanks for the reply. So you are suggesting to modify the network. Do I need to train the data against the modified network again or just modify the architecture and no need to train ??
Yes, I think the network needs to be re-trained.
On Sun, Jul 21, 2024 at 10:22 PM Lohit106 @.***> wrote:
Hi @shizhouxing https://github.com/shizhouxing, thanks for the reply. So you are suggesting to modify the network. Do I need to train the data against the modified network again or just modify the architecture and no need to train ??
— Reply to this email directly, view it on GitHub https://github.com/Verified-Intelligence/auto_LiRPA/issues/76#issuecomment-2242113092, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACUBARC6V7UWHJ7TMPIUNLTZNSJKRAVCNFSM6AAAAABKYHM3BCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENBSGEYTGMBZGI . You are receiving this because you were mentioned.Message ID: @.***>
First of all thankyou for the work. I am using Googlenet model and I am getting this error Traceback (most recent call last): File "/home/plohitvr/ABCrown_test/alpha-beta-CROWN-main/complete_verifier/auto_LiRPA/optimized_bounds.py", line 845, in init_alpha l, u = self.compute_bounds( ^^^^^^^^^^^^^^^^^^^^ File "/home/plohitvr/ABCrown_test/alpha-beta-CROWN-main/complete_verifier/auto_LiRPA/bound_general.py", line 1316, in compute_bounds return self._compute_bounds_main(C=C, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/plohitvr/ABCrown_test/alpha-beta-CROWN-main/complete_verifier/auto_LiRPA/bound_general.py", line 1414, in _compute_bounds_main self.check_prior_bounds(final) File "/home/plohitvr/ABCrown_test/alpha-beta-CROWN-main/complete_verifier/auto_LiRPA/bound_general.py", line 879, in check_prior_bounds self.check_prior_bounds(n) File "/home/plohitvr/ABCrown_test/alpha-beta-CROWN-main/complete_verifier/auto_LiRPA/bound_general.py", line 879, in check_prior_bounds self.check_prior_bounds(n) File "/home/plohitvr/ABCrown_test/alpha-beta-CROWN-main/complete_verifier/auto_LiRPA/bound_general.py", line 879, in check_prior_bounds self.check_prior_bounds(n) [Previous line repeated 40 more times] File "/home/plohitvr/ABCrown_test/alpha-beta-CROWN-main/complete_verifier/auto_LiRPA/bound_general.py", line 897, in check_prior_bounds self.compute_intermediate_bounds( File "/home/plohitvr/ABCrown_test/alpha-beta-CROWN-main/complete_verifier/auto_LiRPA/bound_general.py", line 981, in compute_intermediate_bounds node.lower, node.upper = self.backward_general( ^^^^^^^^^^^^^^^^^^^^^^ File "/home/plohitvr/ABCrown_test/alpha-beta-CROWN-main/complete_verifier/auto_LiRPA/backward_bound.py", line 337, in backward_general A, lower_b, upper_b = l.bound_backward( ^^^^^^^^^^^^^^^^^ File "/home/plohitvr/ABCrown_test/alpha-beta-CROWN-main/complete_verifier/auto_LiRPA/operators/pooling.py", line 86, in bound_backward raise ValueError("self.stride ({}) != self.kernel_size ({})".format(self.stride, self.kernel_size))
ValueError: self.stride ([2, 2]) != self.kernel_size ([3, 3])
This is the model I have used :
def googlenet(num_classes): model = models.googlenet(pretrained=True) model.fc = nn.Linear(model.fc.in_features, num_classes) model = model.to('cpu') return model
I have trained with a data of 2 classes. This is the configuration (yaml) file used:
general: device: cuda model: name: Customized("gognet_dr", "googlenet", num_classes=2) path: models/googlenet_model.pt data: dataset: Customized("gognet_dr", "data") mean: [0.485, 0.456, 0.406] std: [0.229, 0.224, 0.225] num_outputs: 2 specification: epsilon: 0.00784313725 attack: pgd_restarts: 1 pgd_batch_size: 1 solver: batch_size: 2048 beta-crown: iteration: 20 bab: max_domains: 50000 timeout: 300
Nonlinear functions:
BoundRelu(name=/374, inputs=[/x], perturbed=True) BoundMaxPool(name=/input.7, inputs=[/374], perturbed=True) BoundRelu(name=/380, inputs=[/x.4], perturbed=True) BoundRelu(name=/385, inputs=[/x.8], perturbed=True) BoundMaxPool(name=/input.19, inputs=[/385], perturbed=True) BoundRelu(name=/391, inputs=[/x.12], perturbed=True) BoundRelu(name=/396, inputs=[/x.16], perturbed=True) BoundRelu(name=/401, inputs=[/x.20], perturbed=True) BoundRelu(name=/406, inputs=[/x.24], perturbed=True) BoundRelu(name=/411, inputs=[/x.28], perturbed=True) BoundMaxPool(name=/input.43, inputs=[/input.19], perturbed=True) BoundRelu(name=/417, inputs=[/x.32], perturbed=True) BoundRelu(name=/423, inputs=[/x.36], perturbed=True) BoundRelu(name=/428, inputs=[/x.40], perturbed=True) BoundRelu(name=/433, inputs=[/x.44], perturbed=True) BoundRelu(name=/438, inputs=[/x.48], perturbed=True) BoundRelu(name=/443, inputs=[/x.52], perturbed=True) BoundMaxPool(name=/input.75, inputs=[/input.51], perturbed=True) BoundRelu(name=/449, inputs=[/x.56], perturbed=True) BoundMaxPool(name=/input.83, inputs=[/450], perturbed=True) BoundRelu(name=/456, inputs=[/x.60], perturbed=True) BoundRelu(name=/461, inputs=[/x.64], perturbed=True) BoundRelu(name=/466, inputs=[/x.68], perturbed=True) BoundRelu(name=/471, inputs=[/x.72], perturbed=True) BoundRelu(name=/476, inputs=[/x.76], perturbed=True) BoundMaxPool(name=/input.107, inputs=[/input.83], perturbed=True) BoundRelu(name=/482, inputs=[/x.80], perturbed=True) BoundRelu(name=/488, inputs=[/x.84], perturbed=True) BoundRelu(name=/493, inputs=[/x.88], perturbed=True) BoundRelu(name=/498, inputs=[/x.92], perturbed=True) BoundRelu(name=/503, inputs=[/x.96], perturbed=True) BoundRelu(name=/508, inputs=[/x.100], perturbed=True) BoundMaxPool(name=/input.139, inputs=[/input.115], perturbed=True) BoundRelu(name=/514, inputs=[/x.104], perturbed=True) BoundRelu(name=/520, inputs=[/x.108], perturbed=True) BoundRelu(name=/525, inputs=[/x.112], perturbed=True) BoundRelu(name=/530, inputs=[/x.116], perturbed=True) BoundRelu(name=/535, inputs=[/x.120], perturbed=True) BoundRelu(name=/540, inputs=[/x.124], perturbed=True) BoundMaxPool(name=/input.171, inputs=[/input.147], perturbed=True) BoundRelu(name=/546, inputs=[/x.128], perturbed=True) BoundRelu(name=/552, inputs=[/x.132], perturbed=True) BoundRelu(name=/557, inputs=[/x.136], perturbed=True) BoundRelu(name=/562, inputs=[/x.140], perturbed=True) BoundRelu(name=/567, inputs=[/x.144], perturbed=True) BoundRelu(name=/572, inputs=[/x.148], perturbed=True) BoundMaxPool(name=/input.203, inputs=[/input.179], perturbed=True) BoundRelu(name=/578, inputs=[/x.152], perturbed=True) BoundRelu(name=/584, inputs=[/x.156], perturbed=True) BoundRelu(name=/589, inputs=[/x.160], perturbed=True) BoundRelu(name=/594, inputs=[/x.164], perturbed=True) BoundRelu(name=/599, inputs=[/x.168], perturbed=True) BoundRelu(name=/604, inputs=[/x.172], perturbed=True) BoundMaxPool(name=/input.235, inputs=[/input.211], perturbed=True) BoundRelu(name=/610, inputs=[/x.176], perturbed=True) BoundMaxPool(name=/input.243, inputs=[/611], perturbed=True) BoundRelu(name=/617, inputs=[/x.180], perturbed=True) BoundRelu(name=/622, inputs=[/x.184], perturbed=True) BoundRelu(name=/627, inputs=[/x.188], perturbed=True) BoundRelu(name=/632, inputs=[/x.192], perturbed=True) BoundRelu(name=/637, inputs=[/x.196], perturbed=True) BoundMaxPool(name=/input.267, inputs=[/input.243], perturbed=True) BoundRelu(name=/643, inputs=[/x.200], perturbed=True) BoundRelu(name=/649, inputs=[/x.204], perturbed=True) BoundRelu(name=/654, inputs=[/x.208], perturbed=True) BoundRelu(name=/659, inputs=[/x.212], perturbed=True) BoundRelu(name=/664, inputs=[/x.216], perturbed=True) BoundRelu(name=/669, inputs=[/x.220], perturbed=True) BoundMaxPool(name=/input.299, inputs=[/input.275], perturbed=True) BoundRelu(name=/675, inputs=[/x.224], perturbed=True) ########## stride:2, kernel size:3 File "/home/plohitvr/ABCrown_test/alpha-beta-CROWN-main/complete_verifier/auto_LiRPA/operators/pooling.py", line 86, in bound_backward raise ValueError("self.stride ({}) != self.kernel_size ({})".format(self.stride, self.kernel_size)) ValueError: self.stride ([2, 2]) != self.kernel_size ([3, 3])