ChenWu98 / cycle-diffusion

[ICCV 2023] A latent space for stochastic diffusion models
Other
575 stars 35 forks source link

len(dataset_splits['dev'])=0 #6

Closed LiZhangwhu closed 2 years ago

LiZhangwhu commented 2 years ago

When I checked the data load, I noticed len(dataset_splits['dev'])=0. It doesn't look like the data is loaded. Why is that? Where else should I set the path to load the data.

ChenWu98 commented 2 years ago

Can you provide the command and config file you used?

LiZhangwhu commented 2 years ago

the command I used:

export CUDA_VISIBLE_DEVICES=0
export RUN_NAME=translate_text2img256_stable_diffusion_stochastic_custom
export SEED=42
nohup python -m torch.distributed.launch --nproc_per_node 1 --master_port 1426 main.py --seed $SEED --cfg experiments/$RUN_NAME.cfg --run_name $RUN_NAME$SEED --logging_strategy steps --logging_first_step true --logging_steps 4 --evaluation_strategy steps --eval_steps 50 --metric_for_best_model CLIPEnergy --greater_is_better false --save_strategy steps --save_steps 50 --save_total_limit 1 --load_best_model_at_end --gradient_accumulation_steps 4 --num_train_epochs 0 --adafactor false --learning_rate 1e-3 --do_eval --output_dir output/$RUN_NAME$SEED --overwrite_output_dir --per_device_train_batch_size 1 --per_device_eval_batch_size 4 --eval_accumulation_steps 4 --ddp_find_unused_parameters true --verbose true > $RUN_NAME$SEED.log 2>&1 &

the config file I used: translate_text2img256_stable_diffusion_stochastic_custom.cfg: [model] name = text_unsupervised_translation

[gan] gan_type = SDStochasticText source_model_type = sd-v1-4.ckpt custom_steps = 99 white_box_steps = 100 eta = 0.1 encoder_unconditional_guidance_scales = [1] decoder_unconditional_guidance_scales = [1, 3, 5] n_trials = 1 skip_steps = [30, 40]

[raw_data] upsample_temp = 1 range = [128, 500]

[arg_paths] translate = tasks/translate_text512.cfg

[PriorZEnergy] weight = 1

[evaluation] evaluator_program = multi_task

[visualization] visualizer_program = multi_image

translate_text512.cfg: [raw_data] data_program = ./raw_data/empty.py data_cache_dir = ./data/ use_cache = True

[preprocess] preprocess_program = translate_text512 expansion = 1

[evaluation] evaluator_program = translate_text

Thank you so much for your reply!!!

ChenWu98 commented 2 years ago

Hi,

Did you put the information of your customized data at the end of this json file? Specifically, you need to specify encode_text, decode_text, and img_path following the json format.

By the way, I am working with the diffusers team to make the algorithm runnable in a single Colab notebook. I'll mention it in the README when I've finished. Sorry for the inconvenience now!

LiZhangwhu commented 2 years ago

I want to reproduce your algorithm, so I use your data. I selected 10 data from the original jison file, and there is no problem in the data path. The json file is under the data folder. Is there anything else in your algorithm that needs to be changed to match the path of the test data?

Thank you so much for your reply!

ChenWu98 commented 2 years ago

In the config file:

[raw_data]
upsample_temp = 1
range = [128, 500]

The range argument specifies the indices of data in the json file. For instance, when the json file has 138 entries, then setting range = [128, 500] will give us len(dataset_splits['dev'])=10. Hope this information is useful!

LiZhangwhu commented 2 years ago

That's really the reason. Thank you very much for your help!!!