infinityGAN icon indicating copy to clipboard operation
infinityGAN copied to clipboard

NameError: name 'config' is not defined on prepare_data.py

Open reillydonovan opened this issue 3 years ago • 3 comments

Howdy, when I enter the following command I am returned an error, listed below:

python prepare_data.py ./configs/dataset/flickr-landscape-small.yaml --train_only

Traceback (most recent call last): File "prepare_data.py", line 200, in cur_lmdb_root = config.data_params.lmdb_root NameError: name 'config' is not defined

I'm not sure what the issue is here. Any sugestions?

reillydonovan avatar Feb 21 '22 23:02 reillydonovan

Thanks for reporting, it should be args.config, I'll update the codes later. Meanwhile, it is recommended to set LMDB_ROOTS in env_config.py.

hubert0527 avatar Feb 22 '22 03:02 hubert0527

Okay, I've done that, now I'm getting the following error:

File "prepare_data.py", line 227, in assert len(img_paths) >= config.data_params.num_train + config.data_params.num_valid,
AssertionError: 50000 train and 50000 valid, sum up 100000 samples is more than dataset with 2 samples

I have data.mdb and lock.mdb for the flicker-landscape-small downloaded and in the target directory- am I supposed to unpack this? If so how? Thank you so much for your help, I look forward to generating some infinity landscapes!

reillydonovan avatar Feb 22 '22 06:02 reillydonovan

You can directly go for training if you download our lmdb file. The prepare_data.py was meant to build lmdb from an image folder, which is useful when you want to train with your own dataset.

hubert0527 avatar Feb 22 '22 07:02 hubert0527