stylegan2-pytorch icon indicating copy to clipboard operation
stylegan2-pytorch copied to clipboard

How to use prepare_data.py

Open gunahn opened this issue 4 years ago • 4 comments

I want to use prepare_data.py

python prepare_data.py --out LMDB_PATH --n_worker N_WORKER --size SIZE1,SIZE2,SIZE3,... DATASET_PATH

However, when I was trying to use that code, (my data is in folder "numbered_SNUH_knee_512")

python prepare_data.py ../numbered_SNUH_knee_512

error has been occurred.

[File "prepare_data.py", line 104, in <module>
    with lmdb.open(args.out, map_size=1024 ** 4, readahead=False) as env:
TypeError: 'path' argument required]

How am I supposed to write properly?

Thank you

gunahn avatar Jun 02 '21 08:06 gunahn

You need to set --out arguments.

rosinality avatar Jun 06 '21 05:06 rosinality

Aha! Thank you so much for the answer.

I have another question actually,

python -m torch.distributed.launch --nproc_per_node=N_GPU --master_port=PORT train.py --batch BATCH_SIZE LMDB_PATH in this code, what is the PORT? I cannot figure out what that means in this context.

Thank you

gunahn avatar Jun 07 '21 08:06 gunahn

It is arbitrary ports that will be used for distributed training. You can use some free ports.

rosinality avatar Jun 09 '21 14:06 rosinality

hello, does it take only images, not labels? Thanks

Khalilullah-skymatix avatar Jun 16 '22 04:06 Khalilullah-skymatix