VinAIResearch / LFM

Official PyTorch implementation of the paper: Flow Matching in Latent Space
https://vinairesearch.github.io/LFM/
GNU Affero General Public License v3.0
176 stars 6 forks source link

issue about running tests with released pretrained-model. #4

Open glynpu opened 9 months ago

glynpu commented 9 months ago

Hi, Thanks for sharing this project.

Is my generated samples_imagenet_256_dopri5_1e-05_1e-05_cfg1.5.jpg correct, attached below?

image

I am trying to generate some images with the released model_875.pth, i.e. the one in following screenshot. image

The command I am using is:

bash bash_scripts/run_test_cls.sh test_args/imnet_dit.txt 

logs to terminal is

(lfm) t9:~/open_source/LFM: [main]$bash bash_scripts/run_test_cls.sh test_args/imnet_dit.txt
Argument file: test_args/imnet_dit.txt
MODEL_TYPE=DiT-B/2
EPOCH_ID=875
DATASET=imagenet_256
EXP=imnet_f8_ditb2
METHOD=dopri5
STEPS=0
CFG=1.5
starting in debug mode
Finish loading model
Inference
Samples are save at './samples_imagenet_256_dopri5_1e-05_1e-05_cfg1.5.jpg

While the generate 'samples_imagenet_256_dopri5_1e-05_1e-05_cfg1.5.jpg' is mentioned above:

Models and their file structures are:

(lfm) t9:~/open_source/LFM: [main]$tree stabilityai/
stabilityai/
└── sd-vae-ft-mse
    ├── config.json
    ├── diffusion_pytorch_model.bin
    └── diffusion_pytorch_model.safetensors

1 directory, 3 files
(lfm) t9:~/open_source/LFM: [main]$tree saved_info/
saved_info/
└── latent_flow
    └── imagenet_256
        └── imnet_f8_ditb2
            └── model_875.pth

5 directories, 3 files

stabilityai/sd-vae-ft-mse models are downloaded from https://hf-mirror.com/stabilityai/sd-vae-ft-mse/tree/main and their md5sum values are:

c437574b59f6f354bd20022fa9a276a6  config.json
be3354ada70c1ea5c411819660a6e914  diffusion_pytorch_model.bin
4e52586c5a29671f5313b3fa58222496  diffusion_pytorch_model.safetensors

md5sum value of model_875.pth is

ec67dfde747e549eb5932cd67e92c2bb  saved_info/latent_flow/imagenet_256/imnet_f8_ditb2/model_875.pth

The code I am using is the master version with no mocifications, i.e. commit "3e1c3fa142e3b13232dce791b6cabeb83402c348"

Is my generated samples_imagenet_256_dopri5_1e-05_1e-05_cfg1.5.jpg correct? Any suggestions to get the expected results?

hao-pt commented 8 months ago

It is weird because we experience no problem with inference code. I have tried to clone new repo and reinstall all of the required libs and checkpoint models.

root@6b3b847909fd:~/LFM# CUDA_VISIBLE_DEVICES=7 bash bash_scripts/run_test_cls.sh test_args/imnet_dit.txt
Argument file: test_args/imnet_dit.txt
MODEL_TYPE=DiT-B/2
EPOCH_ID=875
DATASET=imagenet_256
EXP=imnet_f8_ditb2
METHOD=dopri5
STEPS=0
CFG=1.5
starting in debug mode
Finish loading model
Inference
Samples are save at './samples_imagenet_256_dopri5_1e-05_1e-05_cfg1.5.jpg

Here is our generated samples with no changes in test args and codes: samples_imagenet_256_dopri5_1e-05_1e-05_cfg1 5