J7 - 对于ResNeXt-50算法的思考

news2024/11/16 19:56:43
  • 🍨 本文为🔗365天深度学习训练营 中的学习记录博客
  • 🍖 原作者:K同学啊 | 接辅导、项目定制

J6周有一段代码如下
Question

思考过程

  1. 首先看到这个问题的描述,想到的是可能使用了向量操作的广播机制
  2. 然后就想想办法验证一下,想到直接把J6的tensorflow代码跑一遍
  3. 通过model.summary打印了模型的所有层的信息,并把信息处理成方便查看(去掉分组卷积的一大堆层)
  4. 发现通道数一致,并不是使用了广播机制
  5. 仔细分析模型的过程,得出解释

验证过程

summary直接打印的内容,(太大只能贴出部分)

Model: "model"
__________________________________________________________________________________________________
 Layer (type)                Output Shape                 Param #   Connected to                  
==================================================================================================
 input_4 (InputLayer)        [(None, 224, 224, 3)]        0         []                            
                                                                                                  
 zero_padding2d_6 (ZeroPadd  (None, 230, 230, 3)          0         ['input_4[0][0]']             
 ing2D)                                                                                           
                                                                                                  
 conv2d_555 (Conv2D)         (None, 112, 112, 64)         9472      ['zero_padding2d_6[0][0]']    
                                                                                                  
 batch_normalization_59 (Ba  (None, 112, 112, 64)         256       ['conv2d_555[0][0]']          
 tchNormalization)                                                                                
                                                                                                  
 re_lu_53 (ReLU)             (None, 112, 112, 64)         0         ['batch_normalization_59[0][0]
                                                                    ']                            
                                                                                                  
 zero_padding2d_7 (ZeroPadd  (None, 114, 114, 64)         0         ['re_lu_53[0][0]']            
 ing2D)                                                                                           
                                                                                                  
 max_pooling2d_3 (MaxPoolin  (None, 56, 56, 64)           0         ['zero_padding2d_7[0][0]']    
 g2D)                                                                                             
                                                                                                  
 conv2d_557 (Conv2D)         (None, 56, 56, 128)          8192      ['max_pooling2d_3[0][0]']     
                                                                                                  
 batch_normalization_61 (Ba  (None, 56, 56, 128)          512       ['conv2d_557[0][0]']          
 tchNormalization)                                                                                
                                                                                                  
 re_lu_54 (ReLU)             (None, 56, 56, 128)          0         ['batch_normalization_61[0][0]
                                                                    ']                            
                                                                                                  
 lambda_514 (Lambda)         (None, 56, 56, 4)            0         ['re_lu_54[0][0]']            
                                                                                                  
 lambda_515 (Lambda)         (None, 56, 56, 4)            0         ['re_lu_54[0][0]']            
                                                                                                  
 lambda_516 (Lambda)         (None, 56, 56, 4)            0         ['re_lu_54[0][0]']            
                                                                                                  
 lambda_517 (Lambda)         (None, 56, 56, 4)            0         ['re_lu_54[0][0]']            
                                                                                                  
 lambda_518 (Lambda)         (None, 56, 56, 4)            0         ['re_lu_54[0][0]']            
                                                                                                  
 lambda_519 (Lambda)         (None, 56, 56, 4)            0         ['re_lu_54[0][0]']            
                                                                                                  
 lambda_520 (Lambda)         (None, 56, 56, 4)            0         ['re_lu_54[0][0]']            
                                                                                                  
 lambda_521 (Lambda)         (None, 56, 56, 4)            0         ['re_lu_54[0][0]']            
                                                                                                  
 lambda_522 (Lambda)         (None, 56, 56, 4)            0         ['re_lu_54[0][0]']            
                                                                                                  
 lambda_523 (Lambda)         (None, 56, 56, 4)            0         ['re_lu_54[0][0]']            
                                                                                                  
 lambda_524 (Lambda)         (None, 56, 56, 4)            0         ['re_lu_54[0][0]']            
                                                                                                  
 lambda_525 (Lambda)         (None, 56, 56, 4)            0         ['re_lu_54[0][0]']            
                                                                                                  
 lambda_526 (Lambda)         (None, 56, 56, 4)            0         ['re_lu_54[0][0]']            
                                                                                                  
 lambda_527 (Lambda)         (None, 56, 56, 4)            0         ['re_lu_54[0][0]']            
                                                                                                  
 lambda_528 (Lambda)         (None, 56, 56, 4)            0         ['re_lu_54[0][0]']            
                                                                                                  
 lambda_529 (Lambda)         (None, 56, 56, 4)            0         ['re_lu_54[0][0]']            
                                                                                                  
 lambda_530 (Lambda)         (None, 56, 56, 4)            0         ['re_lu_54[0][0]']            
                                                                                                  
 lambda_531 (Lambda)         (None, 56, 56, 4)            0         ['re_lu_54[0][0]']            
                                                                                                  
 lambda_532 (Lambda)         (None, 56, 56, 4)            0         ['re_lu_54[0][0]']            
                                                                                                  
 lambda_533 (Lambda)         (None, 56, 56, 4)            0         ['re_lu_54[0][0]']            
                                                                                                  
 lambda_534 (Lambda)         (None, 56, 56, 4)            0         ['re_lu_54[0][0]']            
                                                                                                  
 lambda_535 (Lambda)         (None, 56, 56, 4)            0         ['re_lu_54[0][0]']            
                                                                                                  
 lambda_536 (Lambda)         (None, 56, 56, 4)            0         ['re_lu_54[0][0]']            
                                                                                                  
 lambda_537 (Lambda)         (None, 56, 56, 4)            0         ['re_lu_54[0][0]']            
                                                                                                  
 lambda_538 (Lambda)         (None, 56, 56, 4)            0         ['re_lu_54[0][0]']            
                                                                                                  
 lambda_539 (Lambda)         (None, 56, 56, 4)            0         ['re_lu_54[0][0]']            
                                                                                                  
 lambda_540 (Lambda)         (None, 56, 56, 4)            0         ['re_lu_54[0][0]']            
                                                                                                  
 lambda_541 (Lambda)         (None, 56, 56, 4)            0         ['re_lu_54[0][0]']            
                                                                                                  
 lambda_542 (Lambda)         (None, 56, 56, 4)            0         ['re_lu_54[0][0]']            
                                                                                                  
 lambda_543 (Lambda)         (None, 56, 56, 4)            0         ['re_lu_54[0][0]']            
                                                                                                  
 lambda_544 (Lambda)         (None, 56, 56, 4)            0         ['re_lu_54[0][0]']            
                                                                                                  
 lambda_545 (Lambda)         (None, 56, 56, 4)            0         ['re_lu_54[0][0]']            
                                                                                                  
 conv2d_558 (Conv2D)         (None, 56, 56, 4)            144       ['lambda_514[0][0]']          
                                                                                                  
 conv2d_559 (Conv2D)         (None, 56, 56, 4)            144       ['lambda_515[0][0]']          
                                                                                                  
 conv2d_560 (Conv2D)         (None, 56, 56, 4)            144       ['lambda_516[0][0]']          
                                                                                                  
 conv2d_561 (Conv2D)         (None, 56, 56, 4)            144       ['lambda_517[0][0]']          
                                                                                                  
 conv2d_562 (Conv2D)         (None, 56, 56, 4)            144       ['lambda_518[0][0]']          
                                                                                                  
 conv2d_563 (Conv2D)         (None, 56, 56, 4)            144       ['lambda_519[0][0]']          
                                                                                                  
 conv2d_564 (Conv2D)         (None, 56, 56, 4)            144       ['lambda_520[0][0]']          
                                                                                                  
 conv2d_565 (Conv2D)         (None, 56, 56, 4)            144       ['lambda_521[0][0]']          
                                                                                                  
 conv2d_566 (Conv2D)         (None, 56, 56, 4)            144       ['lambda_522[0][0]']          
                                                                                                  
 conv2d_567 (Conv2D)         (None, 56, 56, 4)            144       ['lambda_523[0][0]']          
                                                                                                  
 conv2d_568 (Conv2D)         (None, 56, 56, 4)            144       ['lambda_524[0][0]']          
                                                                                                  
 conv2d_569 (Conv2D)         (None, 56, 56, 4)            144       ['lambda_525[0][0]']          
                                                                                                  
 conv2d_570 (Conv2D)         (None, 56, 56, 4)            144       ['lambda_526[0][0]']          
                                                                                                  
 conv2d_571 (Conv2D)         (None, 56, 56, 4)            144       ['lambda_527[0][0]']          
                                                                                                  
 conv2d_572 (Conv2D)         (None, 56, 56, 4)            144       ['lambda_528[0][0]']          
                                                                                                  
 conv2d_573 (Conv2D)         (None, 56, 56, 4)            144       ['lambda_529[0][0]']          
                                                                                                  
 conv2d_574 (Conv2D)         (None, 56, 56, 4)            144       ['lambda_530[0][0]']          
                                                                                                  
 conv2d_575 (Conv2D)         (None, 56, 56, 4)            144       ['lambda_531[0][0]']          
                                                                                                  
 conv2d_576 (Conv2D)         (None, 56, 56, 4)            144       ['lambda_532[0][0]']          
                                                                                                  
 conv2d_577 (Conv2D)         (None, 56, 56, 4)            144       ['lambda_533[0][0]']          
                                                                                                  
 conv2d_578 (Conv2D)         (None, 56, 56, 4)            144       ['lambda_534[0][0]']          
                                                                                                  
 conv2d_579 (Conv2D)         (None, 56, 56, 4)            144       ['lambda_535[0][0]']          
                                                                                                  
 conv2d_580 (Conv2D)         (None, 56, 56, 4)            144       ['lambda_536[0][0]']          
                                                                                                  
 conv2d_581 (Conv2D)         (None, 56, 56, 4)            144       ['lambda_537[0][0]']          
                                                                                                  
 conv2d_582 (Conv2D)         (None, 56, 56, 4)            144       ['lambda_538[0][0]']          
                                                                                                  
 conv2d_583 (Conv2D)         (None, 56, 56, 4)            144       ['lambda_539[0][0]']          
                                                                                                  
 conv2d_584 (Conv2D)         (None, 56, 56, 4)            144       ['lambda_540[0][0]']          
                                                                                                  
 conv2d_585 (Conv2D)         (None, 56, 56, 4)            144       ['lambda_541[0][0]']          
                                                                                                  
 conv2d_586 (Conv2D)         (None, 56, 56, 4)            144       ['lambda_542[0][0]']          
                                                                                                  
 conv2d_587 (Conv2D)         (None, 56, 56, 4)            144       ['lambda_543[0][0]']          
                                                                                                  
 conv2d_588 (Conv2D)         (None, 56, 56, 4)            144       ['lambda_544[0][0]']          
                                                                                                  
 conv2d_589 (Conv2D)         (None, 56, 56, 4)            144       ['lambda_545[0][0]']          
                                                                                                  
 concatenate_16 (Concatenat  (None, 56, 56, 128)          0         ['conv2d_558[0][0]',          
 e)                                                                  'conv2d_559[0][0]',          
                                                                     'conv2d_560[0][0]',          
                                                                     'conv2d_561[0][0]',          
                                                                     'conv2d_562[0][0]',          
                                                                     'conv2d_563[0][0]',          
                                                                     'conv2d_564[0][0]',          
                                                                     'conv2d_565[0][0]',          
                                                                     'conv2d_566[0][0]',          
                                                                     'conv2d_567[0][0]',          
                                                                     'conv2d_568[0][0]',          
                                                                     'conv2d_569[0][0]',          
                                                                     'conv2d_570[0][0]',          
                                                                     'conv2d_571[0][0]',          
                                                                     'conv2d_572[0][0]',          
                                                                     'conv2d_573[0][0]',          
                                                                     'conv2d_574[0][0]',          
                                                                     'conv2d_575[0][0]',          
                                                                     'conv2d_576[0][0]',          
                                                                     'conv2d_577[0][0]',          
                                                                     'conv2d_578[0][0]',          
                                                                     'conv2d_579[0][0]',          
                                                                     'conv2d_580[0][0]',          
                                                                     'conv2d_581[0][0]',          
                                                                     'conv2d_582[0][0]',          
                                                                     'conv2d_583[0][0]',          
                                                                     'conv2d_584[0][0]',          
                                                                     'conv2d_585[0][0]',          
                                                                     'conv2d_586[0][0]',          
                                                                     'conv2d_587[0][0]',          
                                                                     'conv2d_588[0][0]',          
                                                                     'conv2d_589[0][0]']          
                                                                                                  
 batch_normalization_62 (Ba  (None, 56, 56, 128)          512       ['concatenate_16[0][0]']      
 tchNormalization)                                                                                
                                                                                                  
 re_lu_55 (ReLU)             (None, 56, 56, 128)          0         ['batch_normalization_62[0][0]
                                                                    ']                            
                                                                                                  
 conv2d_590 (Conv2D)         (None, 56, 56, 256)          32768     ['re_lu_55[0][0]']            
                                                                                                  
 conv2d_556 (Conv2D)         (None, 56, 56, 256)          16384     ['max_pooling2d_3[0][0]']     
                                                                                                  
 batch_normalization_63 (Ba  (None, 56, 56, 256)          1024      ['conv2d_590[0][0]']          
 tchNormalization)                                                                                
                                                                                                  
 batch_normalization_60 (Ba  (None, 56, 56, 256)          1024      ['conv2d_556[0][0]']          
 tchNormalization)                                                                                
                                                                                                  
 add_16 (Add)                (None, 56, 56, 256)          0         ['batch_normalization_63[0][0]
                                                                    ',                            
                                                                     'batch_normalization_60[0][0]
                                                                    ']                            
                                                                                                  
 re_lu_56 (ReLU)             (None, 56, 56, 256)          0         ['add_16[0][0]']              
                                                                                                  
 conv2d_591 (Conv2D)         (None, 56, 56, 128)          32768     ['re_lu_56[0][0]']            
                                                                                                  
 batch_normalization_64 (Ba  (None, 56, 56, 128)          512       ['conv2d_591[0][0]']          
 tchNormalization)                                                                                
                                                                                                  
 re_lu_57 (ReLU)             (None, 56, 56, 128)          0         ['batch_normalization_64[0][0]
                                                                    ']                            
                                                                                                  
 lambda_546 (Lambda)         (None, 56, 56, 4)            0         ['re_lu_57[0][0]']            
                                                                                                  
 lambda_547 (Lambda)         (None, 56, 56, 4)            0         ['re_lu_57[0][0]']            
                                                                                                  
 lambda_548 (Lambda)         (None, 56, 56, 4)            0         ['re_lu_57[0][0]']            
                                                                                                  
 lambda_549 (Lambda)         (None, 56, 56, 4)            0         ['re_lu_57[0][0]']            
                                                                                                  
 lambda_550 (Lambda)         (None, 56, 56, 4)            0         ['re_lu_57[0][0]']            
                                                                                                  
 lambda_551 (Lambda)         (None, 56, 56, 4)            0         ['re_lu_57[0][0]']            
                                                                                                  
 lambda_552 (Lambda)         (None, 56, 56, 4)            0         ['re_lu_57[0][0]']            
                                                                                                  
 lambda_553 (Lambda)         (None, 56, 56, 4)            0         ['re_lu_57[0][0]']            
                                                                                                  
 lambda_554 (Lambda)         (None, 56, 56, 4)            0         ['re_lu_57[0][0]']            
                                                                                                  
 lambda_555 (Lambda)         (None, 56, 56, 4)            0         ['re_lu_57[0][0]']            
                                                                                                  
 lambda_556 (Lambda)         (None, 56, 56, 4)            0         ['re_lu_57[0][0]']            
                                                                                                  
 lambda_557 (Lambda)         (None, 56, 56, 4)            0         ['re_lu_57[0][0]']            
                                                                                                  
 lambda_558 (Lambda)         (None, 56, 56, 4)            0         ['re_lu_57[0][0]']            
                                                                                                  
 lambda_559 (Lambda)         (None, 56, 56, 4)            0         ['re_lu_57[0][0]']            
                                                                                                  
 lambda_560 (Lambda)         (None, 56, 56, 4)            0         ['re_lu_57[0][0]']            
                                                                                                  
 lambda_561 (Lambda)         (None, 56, 56, 4)            0         ['re_lu_57[0][0]']            
                                                                                                  
 lambda_562 (Lambda)         (None, 56, 56, 4)            0         ['re_lu_57[0][0]']            
                                                                                                  
 lambda_563 (Lambda)         (None, 56, 56, 4)            0         ['re_lu_57[0][0]']            
                                                                                                  
 lambda_564 (Lambda)         (None, 56, 56, 4)            0         ['re_lu_57[0][0]']            
                                                                                                  
 lambda_565 (Lambda)         (None, 56, 56, 4)            0         ['re_lu_57[0][0]']            
                                                                                                  
 lambda_566 (Lambda)         (None, 56, 56, 4)            0         ['re_lu_57[0][0]']            
                                                                                                  
 lambda_567 (Lambda)         (None, 56, 56, 4)            0         ['re_lu_57[0][0]']            
                                                                                                  
 lambda_568 (Lambda)         (None, 56, 56, 4)            0         ['re_lu_57[0][0]']            
                                                                                                  
 lambda_569 (Lambda)         (None, 56, 56, 4)            0         ['re_lu_57[0][0]']            
                                                                                                  
 lambda_570 (Lambda)         (None, 56, 56, 4)            0         ['re_lu_57[0][0]']            
                                                                                                  
 lambda_571 (Lambda)         (None, 56, 56, 4)            0         ['re_lu_57[0][0]']            
                                                                                                  
 lambda_572 (Lambda)         (None, 56, 56, 4)            0         ['re_lu_57[0][0]']            
                                                                                                  
 lambda_573 (Lambda)         (None, 56, 56, 4)            0         ['re_lu_57[0][0]']            
                                                                                                  
 lambda_574 (Lambda)         (None, 56, 56, 4)            0         ['re_lu_57[0][0]']            
                                                                                                  
 lambda_575 (Lambda)         (None, 56, 56, 4)            0         ['re_lu_57[0][0]']            
                                                                                                  
 lambda_576 (Lambda)         (None, 56, 56, 4)            0         ['re_lu_57[0][0]']            
                                                                                                  
 lambda_577 (Lambda)         (None, 56, 56, 4)            0         ['re_lu_57[0][0]']            
                                                                                                  
 conv2d_592 (Conv2D)         (None, 56, 56, 4)            144       ['lambda_546[0][0]']          
                                                                                                  
 conv2d_593 (Conv2D)         (None, 56, 56, 4)            144       ['lambda_547[0][0]']          
                                                                                                  
 conv2d_594 (Conv2D)         (None, 56, 56, 4)            144       ['lambda_548[0][0]']          
                                                                                                  
 conv2d_595 (Conv2D)         (None, 56, 56, 4)            144       ['lambda_549[0][0]']          
                                                                                                  
 conv2d_596 (Conv2D)         (None, 56, 56, 4)            144       ['lambda_550[0][0]']          
                                                                                                  
 conv2d_597 (Conv2D)         (None, 56, 56, 4)            144       ['lambda_551[0][0]']          
                                                                                                  
 conv2d_598 (Conv2D)         (None, 56, 56, 4)            144       ['lambda_552[0][0]']          
                                                                                                  
 conv2d_599 (Conv2D)         (None, 56, 56, 4)            144       ['lambda_553[0][0]']          
                                                                                                  
 conv2d_600 (Conv2D)         (None, 56, 56, 4)            144       ['lambda_554[0][0]']          
                                                                                                  
 conv2d_601 (Conv2D)         (None, 56, 56, 4)            144       ['lambda_555[0][0]']          
                                                                                                  
 conv2d_602 (Conv2D)         (None, 56, 56, 4)            144       ['lambda_556[0][0]']          
                                                                                                  
 conv2d_603 (Conv2D)         (None, 56, 56, 4)            144       ['lambda_557[0][0]']          
                                                                                                  
 conv2d_604 (Conv2D)         (None, 56, 56, 4)            144       ['lambda_558[0][0]']          
                                                                                                  
 conv2d_605 (Conv2D)         (None, 56, 56, 4)            144       ['lambda_559[0][0]']          
                                                                                                  
 conv2d_606 (Conv2D)         (None, 56, 56, 4)            144       ['lambda_560[0][0]']          
                                                                                                  
 conv2d_607 (Conv2D)         (None, 56, 56, 4)            144       ['lambda_561[0][0]']          
                                                                                                  
 conv2d_608 (Conv2D)         (None, 56, 56, 4)            144       ['lambda_562[0][0]']          
                                                                                                  
 conv2d_609 (Conv2D)         (None, 56, 56, 4)            144       ['lambda_563[0][0]']          
                                                                                                  
 conv2d_610 (Conv2D)         (None, 56, 56, 4)            144       ['lambda_564[0][0]']          
                                                                                                  
 conv2d_611 (Conv2D)         (None, 56, 56, 4)            144       ['lambda_565[0][0]']          
                                                                                                  
 conv2d_612 (Conv2D)         (None, 56, 56, 4)            144       ['lambda_566[0][0]']          
                                                                                                  
 conv2d_613 (Conv2D)         (None, 56, 56, 4)            144       ['lambda_567[0][0]']          
                                                                                                  
 conv2d_614 (Conv2D)         (None, 56, 56, 4)            144       ['lambda_568[0][0]']          
                                                                                                  
 conv2d_615 (Conv2D)         (None, 56, 56, 4)            144       ['lambda_569[0][0]']          
                                                                                                  
 conv2d_616 (Conv2D)         (None, 56, 56, 4)            144       ['lambda_570[0][0]']          
                                                                                                  
 conv2d_617 (Conv2D)         (None, 56, 56, 4)            144       ['lambda_571[0][0]']          
                                                                                                  
 conv2d_618 (Conv2D)         (None, 56, 56, 4)            144       ['lambda_572[0][0]']          
                                                                                                  
 conv2d_619 (Conv2D)         (None, 56, 56, 4)            144       ['lambda_573[0][0]']          
                                                                                                  
 conv2d_620 (Conv2D)         (None, 56, 56, 4)            144       ['lambda_574[0][0]']          
                                                                                                  
 conv2d_621 (Conv2D)         (None, 56, 56, 4)            144       ['lambda_575[0][0]']          
                                                                                                  
 conv2d_622 (Conv2D)         (None, 56, 56, 4)            144       ['lambda_576[0][0]']          
                                                                                                  
 conv2d_623 (Conv2D)         (None, 56, 56, 4)            144       ['lambda_577[0][0]']          
                                                                                                  
 concatenate_17 (Concatenat  (None, 56, 56, 128)          0         ['conv2d_592[0][0]',          
 e)                                                                  'conv2d_593[0][0]',          
                                                                     'conv2d_594[0][0]',          
                                                                     'conv2d_595[0][0]',          
                                                                     'conv2d_596[0][0]',          
                                                                     'conv2d_597[0][0]',          
                                                                     'conv2d_598[0][0]',          
                                                                     'conv2d_599[0][0]',          
                                                                     'conv2d_600[0][0]',          
                                                                     'conv2d_601[0][0]',          
                                                                     'conv2d_602[0][0]',          
                                                                     'conv2d_603[0][0]',          
                                                                     'conv2d_604[0][0]',          
                                                                     'conv2d_605[0][0]',          
                                                                     'conv2d_606[0][0]',          
                                                                     'conv2d_607[0][0]',          
                                                                     'conv2d_608[0][0]',          
                                                                     'conv2d_609[0][0]',          
                                                                     'conv2d_610[0][0]',          
                                                                     'conv2d_611[0][0]',          
                                                                     'conv2d_612[0][0]',          
                                                                     'conv2d_613[0][0]',          
                                                                     'conv2d_614[0][0]',          
                                                                     'conv2d_615[0][0]',          
                                                                     'conv2d_616[0][0]',          
                                                                     'conv2d_617[0][0]',          
                                                                     'conv2d_618[0][0]',          
                                                                     'conv2d_619[0][0]',          
                                                                     'conv2d_620[0][0]',          
                                                                     'conv2d_621[0][0]',          
                                                                     'conv2d_622[0][0]',          
                                                                     'conv2d_623[0][0]']          
                                                                                                  
 batch_normalization_65 (Ba  (None, 56, 56, 128)          512       ['concatenate_17[0][0]']      
 tchNormalization)                                                                                
                                                                                                  
 re_lu_58 (ReLU)             (None, 56, 56, 128)          0         ['batch_normalization_65[0][0]
                                                                    ']                            

打印的层中,有大量的lambda,对照源代码,lambda操作在分组卷积内,我们可以把这一堆lambda一直到下面的concatenate全部看作在做分组卷积,分组卷积并不改变通道数,只是简化参数量。

# 把summary输出到文件中,使用python脚本处理掉这堆lambda
# 打开文件
f = open('summary')
# 读取内容
content = f.read()
# 按换行切分
lines = content.split('\n')

clean_lines = []
# 过滤处理
for line in lines:
	if len(line.strip()) == 0:
		continue
	if len(line) - len(line.strip()) == 78 or len(line) - len(line.strip()) == 79:
		# 去掉concatenate那一堆connect to
		continue 
	if 'lambda' in line:
		continue
	clean_lines.append(line)
for line in clean_lines:
	print(line)

处理后的模型结构如下

Model: "model"
__________________________________________________________________________________________________
 Layer (type)                Output Shape                 Param #   Connected to
==================================================================================================
 input_4 (InputLayer)        [(None, 224, 224, 3)]        0         []
 zero_padding2d_6 (ZeroPadd  (None, 230, 230, 3)          0         ['input_4[0][0]']
 ing2D)
 conv2d_555 (Conv2D)         (None, 112, 112, 64)         9472      ['zero_padding2d_6[0][0]']
 batch_normalization_59 (Ba  (None, 112, 112, 64)         256       ['conv2d_555[0][0]']
 tchNormalization)
 re_lu_53 (ReLU)             (None, 112, 112, 64)         0         ['batch_normalization_59[0][0]
                                                                    ']
 zero_padding2d_7 (ZeroPadd  (None, 114, 114, 64)         0         ['re_lu_53[0][0]']
 ing2D)
 max_pooling2d_3 (MaxPoolin  (None, 56, 56, 64)           0         ['zero_padding2d_7[0][0]']
 g2D)
 conv2d_557 (Conv2D)         (None, 56, 56, 128)          8192      ['max_pooling2d_3[0][0]']
 batch_normalization_61 (Ba  (None, 56, 56, 128)          512       ['conv2d_557[0][0]']
 tchNormalization)
 re_lu_54 (ReLU)             (None, 56, 56, 128)          0         ['batch_normalization_61[0][0]
                                                                    ']
 concatenate_16 (Concatenat  (None, 56, 56, 128)          0         ['conv2d_558[0][0]',
 e)                                                                  'conv2d_559[0][0]',
 batch_normalization_62 (Ba  (None, 56, 56, 128)          512       ['concatenate_16[0][0]']
 tchNormalization)
 re_lu_55 (ReLU)             (None, 56, 56, 128)          0         ['batch_normalization_62[0][0]
                                                                    ']
 conv2d_590 (Conv2D)         (None, 56, 56, 256)          32768     ['re_lu_55[0][0]']
 conv2d_556 (Conv2D)         (None, 56, 56, 256)          16384     ['max_pooling2d_3[0][0]']
 batch_normalization_63 (Ba  (None, 56, 56, 256)          1024      ['conv2d_590[0][0]']
 tchNormalization)
 batch_normalization_60 (Ba  (None, 56, 56, 256)          1024      ['conv2d_556[0][0]']
 tchNormalization)
 add_16 (Add)                (None, 56, 56, 256)          0         ['batch_normalization_63[0][0]
                                                                    ',
                                                                     'batch_normalization_60[0][0]
                                                                    ']
 re_lu_56 (ReLU)             (None, 56, 56, 256)          0         ['add_16[0][0]']
 conv2d_591 (Conv2D)         (None, 56, 56, 128)          32768     ['re_lu_56[0][0]']
 batch_normalization_64 (Ba  (None, 56, 56, 128)          512       ['conv2d_591[0][0]']
 tchNormalization)
 re_lu_57 (ReLU)             (None, 56, 56, 128)          0         ['batch_normalization_64[0][0]
                                                                    ']
 concatenate_17 (Concatenat  (None, 56, 56, 128)          0         ['conv2d_592[0][0]',
 e)                                                                  'conv2d_593[0][0]',
 batch_normalization_65 (Ba  (None, 56, 56, 128)          512       ['concatenate_17[0][0]']
 tchNormalization)
 re_lu_58 (ReLU)             (None, 56, 56, 128)          0         ['batch_normalization_65[0][0]
                                                                    ']
 conv2d_624 (Conv2D)         (None, 56, 56, 256)          32768     ['re_lu_58[0][0]']
 batch_normalization_66 (Ba  (None, 56, 56, 256)          1024      ['conv2d_624[0][0]']
 tchNormalization)
 add_17 (Add)                (None, 56, 56, 256)          0         ['batch_normalization_66[0][0]
                                                                    ',
                                                                     're_lu_56[0][0]']
 re_lu_59 (ReLU)             (None, 56, 56, 256)          0         ['add_17[0][0]']
 conv2d_625 (Conv2D)         (None, 56, 56, 128)          32768     ['re_lu_59[0][0]']
 batch_normalization_67 (Ba  (None, 56, 56, 128)          512       ['conv2d_625[0][0]']
 tchNormalization)
 re_lu_60 (ReLU)             (None, 56, 56, 128)          0         ['batch_normalization_67[0][0]
                                                                    ']
 concatenate_18 (Concatenat  (None, 56, 56, 128)          0         ['conv2d_626[0][0]',
 e)                                                                  'conv2d_627[0][0]',
 batch_normalization_68 (Ba  (None, 56, 56, 128)          512       ['concatenate_18[0][0]']
 tchNormalization)
 re_lu_61 (ReLU)             (None, 56, 56, 128)          0         ['batch_normalization_68[0][0]
                                                                    ']
 conv2d_658 (Conv2D)         (None, 56, 56, 256)          32768     ['re_lu_61[0][0]']
 batch_normalization_69 (Ba  (None, 56, 56, 256)          1024      ['conv2d_658[0][0]']
 tchNormalization)
 add_18 (Add)                (None, 56, 56, 256)          0         ['batch_normalization_69[0][0]
                                                                    ',
                                                                     're_lu_59[0][0]']
 re_lu_62 (ReLU)             (None, 56, 56, 256)          0         ['add_18[0][0]']
 conv2d_660 (Conv2D)         (None, 56, 56, 256)          65536     ['re_lu_62[0][0]']
 batch_normalization_71 (Ba  (None, 56, 56, 256)          1024      ['conv2d_660[0][0]']
 tchNormalization)
 re_lu_63 (ReLU)             (None, 56, 56, 256)          0         ['batch_normalization_71[0][0]
                                                                    ']
 concatenate_19 (Concatenat  (None, 28, 28, 256)          0         ['conv2d_661[0][0]',
 e)                                                                  'conv2d_662[0][0]',
 batch_normalization_72 (Ba  (None, 28, 28, 256)          1024      ['concatenate_19[0][0]']
 tchNormalization)
 re_lu_64 (ReLU)             (None, 28, 28, 256)          0         ['batch_normalization_72[0][0]
                                                                    ']
 conv2d_693 (Conv2D)         (None, 28, 28, 512)          131072    ['re_lu_64[0][0]']
 conv2d_659 (Conv2D)         (None, 28, 28, 512)          131072    ['re_lu_62[0][0]']
 batch_normalization_73 (Ba  (None, 28, 28, 512)          2048      ['conv2d_693[0][0]']
 tchNormalization)
 batch_normalization_70 (Ba  (None, 28, 28, 512)          2048      ['conv2d_659[0][0]']
 tchNormalization)
 add_19 (Add)                (None, 28, 28, 512)          0         ['batch_normalization_73[0][0]
                                                                    ',
                                                                     'batch_normalization_70[0][0]
                                                                    ']
 re_lu_65 (ReLU)             (None, 28, 28, 512)          0         ['add_19[0][0]']
 conv2d_694 (Conv2D)         (None, 28, 28, 256)          131072    ['re_lu_65[0][0]']
 batch_normalization_74 (Ba  (None, 28, 28, 256)          1024      ['conv2d_694[0][0]']
 tchNormalization)
 re_lu_66 (ReLU)             (None, 28, 28, 256)          0         ['batch_normalization_74[0][0]
                                                                    ']
 concatenate_20 (Concatenat  (None, 28, 28, 256)          0         ['conv2d_695[0][0]',
 e)                                                                  'conv2d_696[0][0]',
 batch_normalization_75 (Ba  (None, 28, 28, 256)          1024      ['concatenate_20[0][0]']
 tchNormalization)
 re_lu_67 (ReLU)             (None, 28, 28, 256)          0         ['batch_normalization_75[0][0]
                                                                    ']
 conv2d_727 (Conv2D)         (None, 28, 28, 512)          131072    ['re_lu_67[0][0]']
 batch_normalization_76 (Ba  (None, 28, 28, 512)          2048      ['conv2d_727[0][0]']
 tchNormalization)
 add_20 (Add)                (None, 28, 28, 512)          0         ['batch_normalization_76[0][0]
                                                                    ',
                                                                     're_lu_65[0][0]']
 re_lu_68 (ReLU)             (None, 28, 28, 512)          0         ['add_20[0][0]']
 conv2d_728 (Conv2D)         (None, 28, 28, 256)          131072    ['re_lu_68[0][0]']
 batch_normalization_77 (Ba  (None, 28, 28, 256)          1024      ['conv2d_728[0][0]']
 tchNormalization)
 re_lu_69 (ReLU)             (None, 28, 28, 256)          0         ['batch_normalization_77[0][0]
                                                                    ']
 concatenate_21 (Concatenat  (None, 28, 28, 256)          0         ['conv2d_729[0][0]',
 e)                                                                  'conv2d_730[0][0]',
 batch_normalization_78 (Ba  (None, 28, 28, 256)          1024      ['concatenate_21[0][0]']
 tchNormalization)
 re_lu_70 (ReLU)             (None, 28, 28, 256)          0         ['batch_normalization_78[0][0]
                                                                    ']
 conv2d_761 (Conv2D)         (None, 28, 28, 512)          131072    ['re_lu_70[0][0]']
 batch_normalization_79 (Ba  (None, 28, 28, 512)          2048      ['conv2d_761[0][0]']
 tchNormalization)
 add_21 (Add)                (None, 28, 28, 512)          0         ['batch_normalization_79[0][0]
                                                                    ',
                                                                     're_lu_68[0][0]']
 re_lu_71 (ReLU)             (None, 28, 28, 512)          0         ['add_21[0][0]']
 conv2d_762 (Conv2D)         (None, 28, 28, 256)          131072    ['re_lu_71[0][0]']
 batch_normalization_80 (Ba  (None, 28, 28, 256)          1024      ['conv2d_762[0][0]']
 tchNormalization)
 re_lu_72 (ReLU)             (None, 28, 28, 256)          0         ['batch_normalization_80[0][0]
                                                                    ']
 concatenate_22 (Concatenat  (None, 28, 28, 256)          0         ['conv2d_763[0][0]',
 e)                                                                  'conv2d_764[0][0]',
 batch_normalization_81 (Ba  (None, 28, 28, 256)          1024      ['concatenate_22[0][0]']
 tchNormalization)
 re_lu_73 (ReLU)             (None, 28, 28, 256)          0         ['batch_normalization_81[0][0]
                                                                    ']
 conv2d_795 (Conv2D)         (None, 28, 28, 512)          131072    ['re_lu_73[0][0]']
 batch_normalization_82 (Ba  (None, 28, 28, 512)          2048      ['conv2d_795[0][0]']
 tchNormalization)
 add_22 (Add)                (None, 28, 28, 512)          0         ['batch_normalization_82[0][0]
                                                                    ',
                                                                     're_lu_71[0][0]']
 re_lu_74 (ReLU)             (None, 28, 28, 512)          0         ['add_22[0][0]']
 conv2d_797 (Conv2D)         (None, 28, 28, 512)          262144    ['re_lu_74[0][0]']
 batch_normalization_84 (Ba  (None, 28, 28, 512)          2048      ['conv2d_797[0][0]']
 tchNormalization)
 re_lu_75 (ReLU)             (None, 28, 28, 512)          0         ['batch_normalization_84[0][0]
                                                                    ']
 concatenate_23 (Concatenat  (None, 14, 14, 512)          0         ['conv2d_798[0][0]',
 e)                                                                  'conv2d_799[0][0]',
 batch_normalization_85 (Ba  (None, 14, 14, 512)          2048      ['concatenate_23[0][0]']
 tchNormalization)
 re_lu_76 (ReLU)             (None, 14, 14, 512)          0         ['batch_normalization_85[0][0]
                                                                    ']
 conv2d_830 (Conv2D)         (None, 14, 14, 1024)         524288    ['re_lu_76[0][0]']
 conv2d_796 (Conv2D)         (None, 14, 14, 1024)         524288    ['re_lu_74[0][0]']
 batch_normalization_86 (Ba  (None, 14, 14, 1024)         4096      ['conv2d_830[0][0]']
 tchNormalization)
 batch_normalization_83 (Ba  (None, 14, 14, 1024)         4096      ['conv2d_796[0][0]']
 tchNormalization)
 add_23 (Add)                (None, 14, 14, 1024)         0         ['batch_normalization_86[0][0]
                                                                    ',
                                                                     'batch_normalization_83[0][0]
                                                                    ']
 re_lu_77 (ReLU)             (None, 14, 14, 1024)         0         ['add_23[0][0]']
 conv2d_831 (Conv2D)         (None, 14, 14, 512)          524288    ['re_lu_77[0][0]']
 batch_normalization_87 (Ba  (None, 14, 14, 512)          2048      ['conv2d_831[0][0]']
 tchNormalization)
 re_lu_78 (ReLU)             (None, 14, 14, 512)          0         ['batch_normalization_87[0][0]
                                                                    ']
 concatenate_24 (Concatenat  (None, 14, 14, 512)          0         ['conv2d_832[0][0]',
 e)                                                                  'conv2d_833[0][0]',
 batch_normalization_88 (Ba  (None, 14, 14, 512)          2048      ['concatenate_24[0][0]']
 tchNormalization)
 re_lu_79 (ReLU)             (None, 14, 14, 512)          0         ['batch_normalization_88[0][0]
                                                                    ']
 conv2d_864 (Conv2D)         (None, 14, 14, 1024)         524288    ['re_lu_79[0][0]']
 batch_normalization_89 (Ba  (None, 14, 14, 1024)         4096      ['conv2d_864[0][0]']
 tchNormalization)
 add_24 (Add)                (None, 14, 14, 1024)         0         ['batch_normalization_89[0][0]
                                                                    ',
                                                                     're_lu_77[0][0]']
 re_lu_80 (ReLU)             (None, 14, 14, 1024)         0         ['add_24[0][0]']
 conv2d_865 (Conv2D)         (None, 14, 14, 512)          524288    ['re_lu_80[0][0]']
 batch_normalization_90 (Ba  (None, 14, 14, 512)          2048      ['conv2d_865[0][0]']
 tchNormalization)
 re_lu_81 (ReLU)             (None, 14, 14, 512)          0         ['batch_normalization_90[0][0]
                                                                    ']
 concatenate_25 (Concatenat  (None, 14, 14, 512)          0         ['conv2d_866[0][0]',
 e)                                                                  'conv2d_867[0][0]',
 batch_normalization_91 (Ba  (None, 14, 14, 512)          2048      ['concatenate_25[0][0]']
 tchNormalization)
 re_lu_82 (ReLU)             (None, 14, 14, 512)          0         ['batch_normalization_91[0][0]
                                                                    ']
 conv2d_898 (Conv2D)         (None, 14, 14, 1024)         524288    ['re_lu_82[0][0]']
 batch_normalization_92 (Ba  (None, 14, 14, 1024)         4096      ['conv2d_898[0][0]']
 tchNormalization)
 add_25 (Add)                (None, 14, 14, 1024)         0         ['batch_normalization_92[0][0]
                                                                    ',
                                                                     're_lu_80[0][0]']
 re_lu_83 (ReLU)             (None, 14, 14, 1024)         0         ['add_25[0][0]']
 conv2d_899 (Conv2D)         (None, 14, 14, 512)          524288    ['re_lu_83[0][0]']
 batch_normalization_93 (Ba  (None, 14, 14, 512)          2048      ['conv2d_899[0][0]']
 tchNormalization)
 re_lu_84 (ReLU)             (None, 14, 14, 512)          0         ['batch_normalization_93[0][0]
                                                                    ']
 concatenate_26 (Concatenat  (None, 14, 14, 512)          0         ['conv2d_900[0][0]',
 e)                                                                  'conv2d_901[0][0]',
 batch_normalization_94 (Ba  (None, 14, 14, 512)          2048      ['concatenate_26[0][0]']
 tchNormalization)
 re_lu_85 (ReLU)             (None, 14, 14, 512)          0         ['batch_normalization_94[0][0]
                                                                    ']
 conv2d_932 (Conv2D)         (None, 14, 14, 1024)         524288    ['re_lu_85[0][0]']
 batch_normalization_95 (Ba  (None, 14, 14, 1024)         4096      ['conv2d_932[0][0]']
 tchNormalization)
 add_26 (Add)                (None, 14, 14, 1024)         0         ['batch_normalization_95[0][0]
                                                                    ',
                                                                     're_lu_83[0][0]']
 re_lu_86 (ReLU)             (None, 14, 14, 1024)         0         ['add_26[0][0]']
 conv2d_933 (Conv2D)         (None, 14, 14, 512)          524288    ['re_lu_86[0][0]']
 batch_normalization_96 (Ba  (None, 14, 14, 512)          2048      ['conv2d_933[0][0]']
 tchNormalization)
 re_lu_87 (ReLU)             (None, 14, 14, 512)          0         ['batch_normalization_96[0][0]
                                                                    ']
 concatenate_27 (Concatenat  (None, 14, 14, 512)          0         ['conv2d_934[0][0]',
 e)                                                                  'conv2d_935[0][0]',
 batch_normalization_97 (Ba  (None, 14, 14, 512)          2048      ['concatenate_27[0][0]']
 tchNormalization)
 re_lu_88 (ReLU)             (None, 14, 14, 512)          0         ['batch_normalization_97[0][0]
                                                                    ']
 conv2d_966 (Conv2D)         (None, 14, 14, 1024)         524288    ['re_lu_88[0][0]']
 batch_normalization_98 (Ba  (None, 14, 14, 1024)         4096      ['conv2d_966[0][0]']
 tchNormalization)
 add_27 (Add)                (None, 14, 14, 1024)         0         ['batch_normalization_98[0][0]
                                                                    ',
                                                                     're_lu_86[0][0]']
 re_lu_89 (ReLU)             (None, 14, 14, 1024)         0         ['add_27[0][0]']
 conv2d_967 (Conv2D)         (None, 14, 14, 512)          524288    ['re_lu_89[0][0]']
 batch_normalization_99 (Ba  (None, 14, 14, 512)          2048      ['conv2d_967[0][0]']
 tchNormalization)
 re_lu_90 (ReLU)             (None, 14, 14, 512)          0         ['batch_normalization_99[0][0]
                                                                    ']
 concatenate_28 (Concatenat  (None, 14, 14, 512)          0         ['conv2d_968[0][0]',
 e)                                                                  'conv2d_969[0][0]',
 batch_normalization_100 (B  (None, 14, 14, 512)          2048      ['concatenate_28[0][0]']
 atchNormalization)
 re_lu_91 (ReLU)             (None, 14, 14, 512)          0         ['batch_normalization_100[0][0
                                                                    ]']
 conv2d_1000 (Conv2D)        (None, 14, 14, 1024)         524288    ['re_lu_91[0][0]']
 batch_normalization_101 (B  (None, 14, 14, 1024)         4096      ['conv2d_1000[0][0]']
 atchNormalization)
 add_28 (Add)                (None, 14, 14, 1024)         0         ['batch_normalization_101[0][0
                                                                    ]',
                                                                     're_lu_89[0][0]']
 re_lu_92 (ReLU)             (None, 14, 14, 1024)         0         ['add_28[0][0]']
 conv2d_1002 (Conv2D)        (None, 14, 14, 1024)         1048576   ['re_lu_92[0][0]']
 batch_normalization_103 (B  (None, 14, 14, 1024)         4096      ['conv2d_1002[0][0]']
 atchNormalization)
 re_lu_93 (ReLU)             (None, 14, 14, 1024)         0         ['batch_normalization_103[0][0
                                                                    ]']
 concatenate_29 (Concatenat  (None, 7, 7, 1024)           0         ['conv2d_1003[0][0]',
 e)                                                                  'conv2d_1004[0][0]',
 batch_normalization_104 (B  (None, 7, 7, 1024)           4096      ['concatenate_29[0][0]']
 atchNormalization)
 re_lu_94 (ReLU)             (None, 7, 7, 1024)           0         ['batch_normalization_104[0][0
                                                                    ]']
 conv2d_1035 (Conv2D)        (None, 7, 7, 2048)           2097152   ['re_lu_94[0][0]']
 conv2d_1001 (Conv2D)        (None, 7, 7, 2048)           2097152   ['re_lu_92[0][0]']
 batch_normalization_105 (B  (None, 7, 7, 2048)           8192      ['conv2d_1035[0][0]']
 atchNormalization)
 batch_normalization_102 (B  (None, 7, 7, 2048)           8192      ['conv2d_1001[0][0]']
 atchNormalization)
 add_29 (Add)                (None, 7, 7, 2048)           0         ['batch_normalization_105[0][0
                                                                    ]',
                                                                     'batch_normalization_102[0][0
                                                                    ]']
 re_lu_95 (ReLU)             (None, 7, 7, 2048)           0         ['add_29[0][0]']
 conv2d_1036 (Conv2D)        (None, 7, 7, 1024)           2097152   ['re_lu_95[0][0]']
 batch_normalization_106 (B  (None, 7, 7, 1024)           4096      ['conv2d_1036[0][0]']
 atchNormalization)
 re_lu_96 (ReLU)             (None, 7, 7, 1024)           0         ['batch_normalization_106[0][0
                                                                    ]']
 concatenate_30 (Concatenat  (None, 7, 7, 1024)           0         ['conv2d_1037[0][0]',
 e)                                                                  'conv2d_1038[0][0]',
 batch_normalization_107 (B  (None, 7, 7, 1024)           4096      ['concatenate_30[0][0]']
 atchNormalization)
 re_lu_97 (ReLU)             (None, 7, 7, 1024)           0         ['batch_normalization_107[0][0
                                                                    ]']
 conv2d_1069 (Conv2D)        (None, 7, 7, 2048)           2097152   ['re_lu_97[0][0]']
 batch_normalization_108 (B  (None, 7, 7, 2048)           8192      ['conv2d_1069[0][0]']
 atchNormalization)
 add_30 (Add)                (None, 7, 7, 2048)           0         ['batch_normalization_108[0][0
                                                                    ]',
                                                                     're_lu_95[0][0]']
 re_lu_98 (ReLU)             (None, 7, 7, 2048)           0         ['add_30[0][0]']
 conv2d_1070 (Conv2D)        (None, 7, 7, 1024)           2097152   ['re_lu_98[0][0]']
 batch_normalization_109 (B  (None, 7, 7, 1024)           4096      ['conv2d_1070[0][0]']
 atchNormalization)
 re_lu_99 (ReLU)             (None, 7, 7, 1024)           0         ['batch_normalization_109[0][0
                                                                    ]']
 concatenate_31 (Concatenat  (None, 7, 7, 1024)           0         ['conv2d_1071[0][0]',
 e)                                                                  'conv2d_1072[0][0]',
 batch_normalization_110 (B  (None, 7, 7, 1024)           4096      ['concatenate_31[0][0]']
 atchNormalization)
 re_lu_100 (ReLU)            (None, 7, 7, 1024)           0         ['batch_normalization_110[0][0
                                                                    ]']
 conv2d_1103 (Conv2D)        (None, 7, 7, 2048)           2097152   ['re_lu_100[0][0]']
 batch_normalization_111 (B  (None, 7, 7, 2048)           8192      ['conv2d_1103[0][0]']
 atchNormalization)
 add_31 (Add)                (None, 7, 7, 2048)           0         ['batch_normalization_111[0][0
                                                                    ]',
                                                                     're_lu_98[0][0]']
 re_lu_101 (ReLU)            (None, 7, 7, 2048)           0         ['add_31[0][0]']
 global_average_pooling2d_1  (None, 2048)                 0         ['re_lu_101[0][0]']
  (GlobalAveragePooling2D)
 dense_1 (Dense)             (None, 1000)                 2049000   ['global_average_pooling2d_1[0
                                                                    ][0]']

观察Add的connected to,发现全都是一样的,并没有出现不一致的情况,竟然和我想的不一样,并没有使用什么广播机制。仔细观察模型的过程才发现,stack的block中,x和filters通道不一致,此时如果直接相加会报错,所以第一个block做了一个通道数*2的卷积。由于后续的filters没有变,输出的通道都是filters*2,所以也可以直接相加。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1467539.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

Element使用Message消息提示

Element使用Message消息提示 一、导入Element1、npm 安装2、引入 Element3、实现代码4、效果 一、导入Element 1、npm 安装 推荐使用 npm 的方式安装 npm i element-ui -S2、引入 Element 在 main.js 中写入以下内容 import ElementUI from element-ui; import element-ui…

FFmpeg解析之avformat_find_stream_info函数

avformat_find_stream_info 的主要作用就是:解析媒体文件并获取相关的流信息 整体的逻辑如下图所示: /*** Read packets of a media file to get stream information. This* is useful for file formats with no headers such as MPEG. This* function…

现货黄金中短线投资该怎么做?

要明确什么是现货黄金的中短线投资,中短线投资是指在短期内(一般为几天至几周)对现货黄金进行买卖操作,以期获得收益的投资方式。相较于长线投资,中短线投资的风险相对较大,但同时收益也更为可观。那么&…

算法题目中图和树的存储

邻接表的方式存储图和树 这就是邻接表,就是将每个结点的孩子结点用链表表示出来,再将所有结点以数组形式连起来。 存储树和图我们需要三个数组,h[N], e[N], ne[N],分别表示邻接表,结点值,结点的next值,h[i…

Zookeeper简介及选举机制

1.概述 Zookeeper是一个开源的,分布式的,为分布式框架(如下图中的Hadoop和Hive)提供协调服务的Apache项目。 工作机制:基于观察者设计模式的分布式服务管理框架,负责存储和管理数据,接受观察者…

Set集合(Java) 及底层原理

SET<E>是一个接口&#xff0c;添加的元素是无序的&#xff1a;添加数据的顺序和获取出的数据顺序不一致&#xff1b;不重复&#xff0c;无索引。 实现类&#xff1a; 1.HashSet&#xff1a;无序不重复无索引 2.LinkedHashSet&#xff1a;有序不重复无索引 3.TreeSet&…

最佳 PDF 转 Word 转换器软件,可实现无缝转换

如今&#xff0c;PDF文件格式因其高安全性而被计算机用户所熟悉&#xff0c;这使得无法直接编辑内容。因此&#xff0c;每当用户需要复制内容时&#xff0c;都会遇到很多困难。在这里将介绍了一些可以让您将 PDF 转换为 Word 的工具。 借助高效、免费的 PDF 转 Word 转换器软件…

离散数学(一) 集合

属于关系 表示 枚举法&#xff1b; 叙述法&#xff1b; 文氏图法 基数 空集 全集 全集是相对唯一的 相等关系 有相同元素看作一个元素 包含关系 幂集 集合运算 并集 交集 补集 差集 对称差集 定理 可数集合与不可数集合 自然数集 等势 如果存在集合A到集合B的双射(又称一一…

PostgreSQL如何使用UUID

离线安装时&#xff0c;一般有四个包&#xff0c;都安装的话&#xff0c;只需要开启uuid的使用即可&#xff0c;如果工具包(即 postgresql11-contrib&#xff09;没有安装的话&#xff0c;需要单独安装一次&#xff0c;再进行开启。 开启UUID方法 下面介绍一下如何开启&#…

分布式事务Seata的使用详解

一、事务概述 事务指的就是一个操作单元&#xff0c;在这个操作单元中的所有操作最终要保持一致的行为&#xff0c;要么所有操作 都成功&#xff0c;要么所有的操作都被撤销。简单地说&#xff0c;事务提供一种“要么什么都不做&#xff0c;要么做全套”机制。 1.1.本地事物 …

Linux基础知识——命令行模式下命令的执行

文章目录 Linux基础知识——命令行模式下命令的执行开始执行Linux命令Linux基础命令的操作常用Linux命令行操作按键Linux输出错误信息查看 Linux系统在线帮助--help选项man命令info命令其他有用的文件文档百度搜索 文本编辑器&#xff1a;nanonano启动&#xff01; 正确关机方法…

自动化行业文件数据\资料防泄密软件——天锐绿盾|@德人合科技

天锐绿盾是一款自动化行业文件数据防泄密软件&#xff0c;由德人合科技提供。该软件采用动态加解密技术&#xff0c;能够有效防止公司内部数据泄密&#xff0c;同时支持各种文件格式加密&#xff0c;如CAD、OFFICE、PDF、图纸等。 PC端&#xff1a;https://isite.baidu.com/sit…

第1讲-introduction

计算机组成与结构简介 计算机的基本组成 计算机的层次结构

从零开始学逆向:理解ret2syscall

1.题目信息 链接&#xff1a;https://pan.baidu.com/s/19ymHlZZmVGsJHFmmlwww0w 提取码&#xff1a;r4el 首先checksec 看一下保护机制 2.原理 ret2syscall 即控制程序执行系统调用来获取 shell 什么是系统调用&#xff1f; 操作系统提供给用户的编程接口是提供访问操作系统…

JavaScript原型继承与面向对象编程思想

原型继承与面向对象编程思想 在JavaScript中&#xff0c;原型(prototype)、构造函数(constructor)和实例对象(instance)是面向对象编程中的重要概念&#xff0c;并且它们之间存在着紧密的关系。 原型(prototype)&#xff1a;原型是JavaScript中对象之间关联的一种机制。每个Ja…

ElasticSearch之bool多条件查询

写在前面 在实际的业务场景中&#xff0c;不可能只是简单的单值查询 &#xff0c;更多的是n个条件的综合查询&#xff0c;就像下面的搜索&#xff1a; 针对这种场景我们就需要依赖于bool查询了&#xff0c;本文就一起来看下这部分的内容。 1&#xff1a;bool查询介绍 bool查…

第十一天-Excel的操作

目录 1.xlrd-Excel的读模块 安装 使用 获取工作簿 读取工作簿的内容 xlsxwriter-Excel的写模块 安装 使用 生成图表 add_series参数 图表的样式 demo&#xff1a;生成图表 Excel的操作在python中有多个模块&#xff0c;为了能够快速使用&#xff0c;选择了相对简单…

CloudFlare免费内网穿透

介绍 Cloudflare Tunnel是Cloudflare零信任网络的一个产品&#xff0c;用于打通企业、员工、设备之间的边界&#xff0c;从而摒弃掉VPN之类的过时技术&#xff08;其实也不是过时&#xff0c;只不过是相对来说安全性、可控性较差&#xff09; 通过Cloudflare Tunnel&#xff0c…

国家建筑装配式内装产业基地在沪成立,副主任单位优积科技协同助推绿色低碳循环发展

上海市室内装饰行业协会装配式内装产业专业委员会成立大会暨“国家建筑装配式内装产业基地”项目启动会于3月21日下午1点在上海光大酒店隆重举行。出席此次活动的包括市装协会长徐国俭&#xff0c;市装协党支部书记兼秘书长丛国梁&#xff0c;市装协装配式内装委主任顾泰昌&…

java面试设计模式篇

面试专题-设计模式 前言 在平时的开发中&#xff0c;涉及到设计模式的有两块内容&#xff0c;第一个是我们平时使用的框架&#xff08;比如spring、mybatis等&#xff09;&#xff0c;第二个是我们自己开发业务使用的设计模式。 面试官一般比较关心的是你在开发过程中&#…