Skip to content

Commit

Permalink
Update densenet.py
Browse files Browse the repository at this point in the history
  • Loading branch information
pokemonjs authored Sep 25, 2021
1 parent 1eb5546 commit 00586cf
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions python/paddle/vision/models/densenet.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
'DenseNet201': ('')
}


class DenseLayer(nn.Layer):

def __init__(self, in_c, growth_rate, bn_size):
Expand All @@ -38,7 +39,7 @@ def __init__(self, in_c, growth_rate, bn_size):
nn.BatchNorm2D(out_c),
nn.ReLU(),
nn.Conv2D(
out_c, growth_rate, 3,padding=1))
out_c, growth_rate, 3, padding=1))

def forward(self, x):
y = self.layers(x)
Expand Down Expand Up @@ -80,7 +81,7 @@ class DenseNet(nn.Layer):
def __init__(self,
num_classes=1000,
growth_rate=32,
block=(6,12,24,16),
block=(6, 12, 24, 16),
bn_size=4,
out_c=64):
super().__init__()
Expand Down Expand Up @@ -127,29 +128,29 @@ def densenet121(pretrained=False, batch_norm=False, **kwargs):
model_name = 'DenseNet121'
if batch_norm:
model_name += ('_bn')
return _DenseNet(model_name, (6,12,24,16), batch_norm, pretrained,
return _DenseNet(model_name, (6, 12, 24, 16), batch_norm, pretrained,
**kwargs)


def densenet161(pretrained=False, batch_norm=False, **kwargs):
model_name = 'DenseNet161'
if batch_norm:
model_name += ('_bn')
return _DenseNet(model_name, (6,12,32,32), batch_norm, pretrained,
return _DenseNet(model_name, (6, 12, 32, 32), batch_norm, pretrained,
**kwargs)


def densenet169(pretrained=False, batch_norm=False, **kwargs):
model_name = 'DenseNet169'
if batch_norm:
model_name += ('_bn')
return _DenseNet(model_name, (6,12,48,32), batch_norm, pretrained,
return _DenseNet(model_name, (6, 12, 48, 32), batch_norm, pretrained,
**kwargs)


def densenet201(pretrained=False, batch_norm=False, **kwargs):
model_name = 'DenseNet201'
if batch_norm:
model_name += ('_bn')
return _DenseNet(model_name, (6,12,64,48), batch_norm, pretrained,
return _DenseNet(model_name, (6, 12, 64, 48), batch_norm, pretrained,
**kwargs)

1 comment on commit 00586cf

@paddle-bot-old
Copy link

@paddle-bot-old paddle-bot-old bot commented on 00586cf Sep 25, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🕵️ CI failures summary

🔍 PR: #36072 Commit ID: 00586cf contains failed CI.

🔹 Failed: PR-CI-Kunlun

Unknown Failed
2021-09-25 19:30:30 [INFO] Running on (Kunlun-2) with agent(v1.2.7) in workspace /home/xly/workspace/0b17d0f9-75cf-438d-b7a7-a970eb72eb6d
2021-09-25 19:30:30 + set +x
2021-09-25 19:30:30 Cleanup...
2021-09-25 19:30:40 + '[' -d /home/ssd1/Paddle ']'
2021-09-25 19:30:40 + rm -rf /home/ssd1/Paddle
2021-09-25 19:30:43 rm: 无法删除"/home/ssd1/Paddle/build": 目录非空

🔹 Failed: PR-CI-CPU-Py2

code_style_failed
2021-09-25 19:43:15     with_avx: ON
2021-09-25 19:43:15 with_gpu: ON
2021-09-25 19:43:15 with_mkl: ON
2021-09-25 19:43:15 with_mkldnn: ON
2021-09-25 19:43:15 with_python: ON'
2021-09-25 19:43:15 + set +x
2021-09-25 19:43:15 ========================================
2021-09-25 19:43:15 summary problems:
2021-09-25 19:43:15 There is 1 error: Code format error.
2021-09-25 19:43:15 ========================================
2021-09-25 19:43:15 Code format error Please fix it according to the diff information:
2021-09-25 19:43:15 code format error
2021-09-25 19:43:15 diff --git a/python/paddle/vision/models/densenet.py b/python/paddle/vision/models/densenet.py
2021-09-25 19:43:15 index 8277323..b2b2592 100644
2021-09-25 19:43:15 --- a/python/paddle/vision/models/densenet.py
2021-09-25 19:43:15 +++ b/python/paddle/vision/models/densenet.py
2021-09-25 19:43:15 @@ -28,7 +28,6 @@ model_urls = {
2021-09-25 19:43:15
2021-09-25 19:43:15
2021-09-25 19:43:15 class DenseLayer(nn.Layer):
2021-09-25 19:43:15 -

🔹 Failed: PR-CI-Coverage

coverage_failed
2021-09-25 21:11:57 ./vision/models/index.html
2021-09-25 21:11:57 ./vision/models/densenet.py.gcov.html
2021-09-25 21:11:57 ./vision/models/init.py.gcov.html
2021-09-25 21:11:57 ./vision/models/index-sort-l.html
2021-09-25 21:11:57 ./vision/init.py.gcov.html
2021-09-25 21:11:57 ./vision/index-sort-l.html
2021-09-25 21:11:57 ./index-sort-l.html
2021-09-25 21:11:57 ./glass.png
2021-09-25 21:11:57 + du -hs /tmp/upload-0f4a941c-0ebd-479f-a4d7-35c954ec4820.tar.gz
2021-09-25 21:11:57 12K /tmp/upload-0f4a941c-0ebd-479f-a4d7-35c954ec4820.tar.gz
2021-09-25 21:11:57 + curl -s --connect-timeout 600 --retry 10 --retry-delay 10 -u paddle:915eedab953b6f51151f50eb -F buildId=7801263 -F path=python-coverage -F file=@/tmp/upload-0f4a941c-0ebd-479f-a4d7-35c954ec4820.tar.gz https://xly.bce.baidu.com/ipipe/ipipe-report/upload
2021-09-25 21:11:57 + rm -f /tmp/upload-0f4a941c-0ebd-479f-a4d7-35c954ec4820.tar.gz
2021-09-25 21:11:57 report uploaded
2021-09-25 21:11:57 9
2021-09-25 21:11:57 ipipe_log_param_EXCODE: 9
2021-09-25 21:11:57 Sorry, coverage check failed.
2021-09-25 21:11:57 + exit 9
2021-09-25 21:11:57 {build code state=9}
2021-09-25 21:12:07 kill agent BUILD_CODE_FAIL

Please sign in to comment.