Skip to content

Commit

Permalink
fix unittest
Browse files Browse the repository at this point in the history
  • Loading branch information
LielinJiang committed Nov 17, 2020
1 parent 41d7b76 commit 5a6c4a1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion python/paddle/vision/models/resnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ def forward(self, x):
x = self.layer3(x)
x = self.layer4(x)

if self.with_pool > 0:
if self.with_pool:
x = self.avgpool(x)

if self.num_classes > 0:
Expand Down
2 changes: 1 addition & 1 deletion python/paddle/vision/models/vgg.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def __init__(self, features, num_classes=1000, with_pool=True):
if with_pool:
self.avgpool = nn.AdaptiveAvgPool2D((7, 7))

if num_classes > 1000:
if num_classes > 0:
self.classifier = nn.Sequential(
nn.Linear(512 * 7 * 7, 4096),
nn.ReLU(),
Expand Down

1 comment on commit 5a6c4a1

@paddle-bot-old
Copy link

Choose a reason for hiding this comment

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

Congratulation! Your pull request passed all required CI. You could ask reviewer(s) to approve and merge. 🎉

Please sign in to comment.