Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] fix sd torch16 ut #1616

Merged
merged 6 commits into from
Jan 30, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion mmedit/models/editors/ddpm/denoising_unet.py
Original file line number Diff line number Diff line change
Expand Up @@ -1108,6 +1108,7 @@ def __init__(self,

if self.unet_type == 'stable':
# out
self.conv_act = None
LeoXing1996 marked this conversation as resolved.
Show resolved Hide resolved
self.conv_norm_out = nn.GroupNorm(
num_channels=block_out_channels[0],
num_groups=norm_cfg['num_groups'])
Expand All @@ -1117,7 +1118,7 @@ def __init__(self,
mmengine.print_log('\'SiLU\' is not supported for '
f'torch < 1.6.0, found \'{torch.version}\'.'
'Use ReLu instead but result maybe wrong')
self.conv_act == nn.ReLU()
self.conv_act = nn.ReLU()
self.conv_out = nn.Conv2d(
block_out_channels[0],
self.out_channels,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Copyright (c) OpenMMLab. All rights reserved.
import platform
import sys

import pytest
import torch
Expand Down Expand Up @@ -102,8 +101,6 @@ def __call__(self, x, attention_mask):
@pytest.mark.skipif(
'win' in platform.system().lower(),
reason='skip on windows due to limited RAM.')
@pytest.mark.skipif(
sys.version_info < (3, 8), reason='skip because python version is old.')
def test_stable_diffusion():
StableDiffuser = MODELS.build(Config(model))
StableDiffuser.tokenizer = dummy_tokenizer()
Expand Down