Skip to content

Commit

Permalink
fix unit test bug in gpu
Browse files Browse the repository at this point in the history
  • Loading branch information
nbei committed Aug 5, 2021
1 parent 79e7dea commit 74f81e0
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
2 changes: 1 addition & 1 deletion mmedit/models/losses/gan_loss.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def gradient_penalty_loss(discriminator, real_data, fake_data, mask=None):
"""

batch_size = real_data.size(0)
alpha = real_data.new_tensor(torch.rand(batch_size, 1, 1, 1))
alpha = torch.rand(batch_size, 1, 1, 1).to(real_data)

# interpolate between real_data and fake_data
interpolates = alpha * real_data + (1. - alpha) * fake_data
Expand Down
11 changes: 0 additions & 11 deletions tests/test_models/test_inpaintors/test_deepfill_inpaintor.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,17 +266,6 @@ def test_two_stage_inpaintor():
loss_weight=1.0,
),
loss_disc_shift=dict(type='DiscShiftLoss'),
loss_composed_percep=dict(
type='PerceptualLoss',
vgg_type='vgg16',
layer_weights={
'4': 1.,
'9': 1.,
'16': 1.,
},
perceptual_weight=0.05,
style_weight=120,
pretrained='torchvision://vgg16'),
pretrained=None)
tsinpaintor = DeepFillv1Inpaintor(
**model_, train_cfg=train_cfg, test_cfg=test_cfg).cuda()
Expand Down

0 comments on commit 74f81e0

Please sign in to comment.