tqch / ddpm-torch Goto Github PK
View Code? Open in Web Editor NEWUnofficial PyTorch Implementation of Denoising Diffusion Probabilistic Models (DDPM)
License: MIT License
Unofficial PyTorch Implementation of Denoising Diffusion Probabilistic Models (DDPM)
License: MIT License
HI!Your work is excellent.
I would like to ask if you have pretrained models on the Celeb-HQ dataset or some else at different resolutions, such as 64x64, 128x128, and so on?
You are doing MSE(noise, predicted_noise)
. Shouldn't it be MSE(coef2*noise, predicted_noise)
?
ddpm-torch/ddpm_torch/diffusion.py
Line 235 in 1bf0e5d
I have to implement a conditional diffusion model for synthesizing realistic face images from a feature vector. I found this repo very clarifying. Thank you very much for sharing it!
I made a fork to support conditional sample generation using classifier-free guidance. I have been able to successfully generate class-conditioned samples for the MNIST and CIFAR10 datasets. However, I have not been able to generate CELEBA samples using a feature vector as a condition. I was wondering if these models can be adapted to support not only class-conditioning using classifier-free guidance but also vector-conditioning.
I would greatly appreciate any insights you might have on this matter. Thank you in advance for your time and consideration.
Can you provide the exact config you used to get those weights which you linked to?
Hi, thanks for sharing your code.
I found that q_mean_var
function in GaussianDiffusion
implementation is strange.
ddpm-torch/ddpm_torch/diffusion.py
Lines 86 to 90 in 9a8ecb5
logvar
variable should literally store log value of var (like torch.log(var)
) maybe?Hi, I tried generating samples with the example command
python generate.py --dataset cifar10 --chkpt-path ./chkpts/cifar10/cifar10_2040.pt --use-ddim --skip-schedule quadratic --subseq-size 100 --suffix _ddim --num-gpus 4
using the provided checkpoint and calculate the fid using the provided script. The FID I got is only 4.346242031101042 which is different than the reported evaluated metrics table. I'm wondering how to use the checkpoint to achieve the reported number. Thanks!
could you display the celebahq 256 size pretrained model
Hi, thanks for your great work for implementing the DDPM baseline. I'm curious about the FID in CelebaHQ, since I have got 21.64 which may be too higher for DDPM. So if possiable, please let me know the correctness of the above results. Thanks!
Hi, thanks for your great work in implementing the DDPM baseline.
I'm curious about the changes in numberOfSteps, betas start and end, when changing the sampler from DDPM to DDIM. could you please provide me with the DDIM sampler training parameters.
Thank you in advance.
When I used the following command with your provided checkpoint
python generate.py --dataset cifar10 --chkpt-path cifar10_2040.pt --use-ddim --skip-schedule quadratic --subseq-size 100 --suffix _ddim --num-gpus 2
I receive the following error:
-- Process 1 terminated with the following error:
Traceback (most recent call last):
File "/home/remy/.local/lib/python3.10/site-packages/torch/multiprocessing/spawn.py", line 75, in _wrap
fn(i, *args)
File "/home/remy/ddpm-torch/generate.py", line 72, in generate
state_dict = torch.load(chkpt_path, map_location=device)["ema"]["shadow"]
KeyError: 'ema'
Hi, thanks for your amazing project!
Anyway I was looking through your code and found that while calculating covariance matrix in fid_score.py
you set ddof
to 0 .
ddpm-torch/ddpm_torch/metrics/fid_score.py
Line 124 in 5a2566e
But when I look at pytorch-fid library, it seems like they didn't set ddof
to 0, which mean they set ddof
to None.
https://github.com/mseitzer/pytorch-fid/blob/0a754fb8e66021700478fd365b79c2eaa316e31b/src/pytorch_fid/fid_score.py#L230
Is there any reason you set ddof
parameter to 0? It seems like setting ddof
to 0 or not makes significant change in FID score. For example, I trained DDPM for cifar10 dataset and tried to calculate FID score. If I set ddof
to 0 then resulting FID score was about 8 but when I just use default value for ddof
just like pytorch-fid library did it, then resulting FID score was about 11.
Furthermore DDPM library by lucidrains (https://github.com/lucidrains/denoising-diffusion-pytorch), which is one of the most known library implementing DDPM in pytorch, also calculates FID score with ``ddof``` to default value(None)
So I was qurious about the reason you set ddof=0
.
Thanks in advance!
Hi,
I used the following command to train the model on CIFAR10
python train.py --dataset cifar10 --num-gpus 4 --use-ema --eval --distributed --rigid-launch
which I was able to achieve the same FID at epoch 2040 as in the performance table.
However, when I keep training it longer, the loss decreases, but FID is worse (picture below). I'm wondering if this is expected or if you have experienced this behavior before?
Small details that I'm not sure if they matter is that 1) I change the number of epoch in the config file after training the first 2040 epochs, and 2) I resume the training process on a different machine/GPU.
Thank you for your time!
Hello, I am recently learning DDPM, can you tell me how to use your code to train my own image dataset, all images in the same folder?
Hi, tqch! Thank you for your excellent work! However, I found the code can not work well if I select the --eval
arg for training. As I know, maybe there is something wrong with the sample_fn
function. Can you fix this bug? Thank you very much.
Hi, I really like your codebase of DDPM.
Have you implemented mix precision training or any kind of method that would speed up training?
Thanks
Comment is wrong:
ddpm-torch/ddpm_torch/models/unet.py
Line 184 in 1bf0e5d
Align_corners=true is now supported by PyTorch. Perhaps the code should be updated?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.