Comments (2)
这个是传递的参数有问题~ 正确的代码如下:
@torch.no_grad()
def log_images(self, batch, sample_steps=50):
log = dict()
z, c = self.get_input(batch, self.first_stage_key)
c_lq = c["lq"][0]
c_latent = c["c_latent"][0]
c_cat, c = c["c_concat"][0], c["c_crossattn"][0]
log["hq"] = (self.decode_first_stage(z) + 1) / 2
log["control"] = c_cat
log["decoded_control"] = (self.decode_first_stage(c_latent) + 1) / 2
log["lq"] = c_lq
log["text"] = (log_txt_as_img((512, 512), batch[self.cond_stage_key], size=16) + 1) / 2
log["samples"] = self.sample_log(
cond_img=c_cat,
steps=sample_steps
)
return log
@torch.no_grad()
def sample_log(self, cond_img, steps):
sampler = SpacedSampler(self)
b, c, h, w = cond_img.shape
shape = (b, self.channels, h // 8, w // 8)
samples = sampler.sample(
steps, shape, cond_img, positive_prompt="", negative_prompt="",
cfg_scale=1.0, color_fix_type="wavelet"
)
return samples
最近有点忙,所以没时间更新代码,抱歉。
from diffbir.
我也碰到了这个问题,请问你找到了解决方法吗
from diffbir.
Related Issues (20)
- the resolution and classes of imagenet dataset HOT 2
- Training questions HOT 1
- 使用更大规模的数据训练,会有更好的效果吗? HOT 16
- about how to show low quality image HOT 1
- set w/o restoration module HOT 1
- Can this network do the work of image deblurring? HOT 1
- 为什么要用在低清图上finetune的encoder? HOT 2
- AMD GPU support?
- GPU Memory HOT 1
- TypeError: sample() missing 2 required positional arguments: 'positive_prompt' and 'negative_prompt' HOT 2
- RuntimeError: Given groups=1, weight of size [4, 4, 1, 1], expected input[1, 3, 512, 512] to have 4 channels, but got 3 channels instead HOT 1
- 如果我想用自己的数据训练的话,这个模型可以应用在修复老照片的任务吗?
- Question on training Stage2 with Real-ESRGAN degradation HOT 4
- Unable to train the algorithms with 2 GPU instances (multi-node), each with 4 A100s
- Training killed without error shorting after starting HOT 1
- RuntimeError: PytorchStreamReader failed reading zip archive: invalid header or archive is corrupted? which file ? HOT 1
- Some Question about Sampler?
- Could someone manage how to run diffbir face restoration with bsrgan upscale models, not realesrgan?
- Intel Arc support
- 我的程序不出图,一直在加载 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from diffbir.