Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lmdb has no valid image file #70

Closed
MHketbi opened this issue Jul 20, 2022 · 3 comments
Closed

lmdb has no valid image file #70

MHketbi opened this issue Jul 20, 2022 · 3 comments

Comments

@MHketbi
Copy link

MHketbi commented Jul 20, 2022

i get this error

  File "C:\ManduScale\Train\codes\train.py", line 500, in <module>
    main()
  File "C:\ManduScale\Train\codes\train.py", line 487, in main
    dataloaders, data_params = get_dataloaders(opt)
  File "C:\ManduScale\Train\codes\train.py", line 134, in get_dataloaders
    dataset = create_dataset(dataset_opt)
  File "C:\ManduScale\Train\codes\data\__init__.py", line 79, in create_dataset
    dataset = D(dataset_opt)
  File "C:\ManduScale\Train\codes\data\aligned_dataset.py", line 41, in __init__
    self.A_paths, self.B_paths = get_dataroots_paths(self.opt, strict=False, keys_ds=self.keys_ds)
  File "C:\ManduScale\Train\codes\data\base_dataset.py", line 235, in get_dataroots_paths
    paths_A, paths_B = read_dataroots(opt, keys_ds=keys_ds)
  File "C:\ManduScale\Train\codes\data\base_dataset.py", line 168, in read_dataroots
    paths_A, paths_B = paired_dataset_validation(A_images_paths, B_images_paths,
  File "C:\ManduScale\Train\codes\data\base_dataset.py", line 99, in paired_dataset_validation
    A_paths = get_image_paths(data_type, paths[0], max_dataset_size)  # get image paths
  File "C:\ManduScale\Train\codes\dataops\common.py", line 82, in get_image_paths
    paths = sorted(_get_paths_from_images(dataroot, max_dataset_size=max_dataset_size))
  File "C:\ManduScale\Train\codes\dataops\common.py", line 43, in _get_paths_from_images
    assert images, '{:s} has no valid image file'.format(path)
AssertionError: C:\ManduScale\OPScale\DataSet\FourthSet\LR1.lmdb has no valid image file

my config is

dataroot_HR: ['C:\ManduScale\OPScale\DataSet\FourthSet\HR', 
    'C:\ManduScale\OPScale\DataSet\FourthSet\HR', 
    'C:\ManduScale\OPScale\DataSet\FourthSet\HR', 
    'C:\ManduScale\OPScale\DataSet\FourthSet\HR', 
    'C:\ManduScale\OPScale\DataSet\FourthSet\HR', 
    'C:\ManduScale\OPScale\DataSet\FourthSet\HR', 
    'C:\ManduScale\OPScale\DataSet\FourthSet\HR', 
    'C:\ManduScale\OPScale\DataSet\FourthSet\HR', 
    'C:\ManduScale\OPScale\DataSet\FourthSet\HR', 
    'C:\ManduScale\OPScale\DataSet\FourthSet\HR', 
    'C:\ManduScale\OPScale\DataSet\FourthSet\HR', 
    'C:\ManduScale\OPScale\DataSet\FourthSet\HR', 
    'C:\ManduScale\OPScale\DataSet\FourthSet\HR', 
    'C:\ManduScale\OPScale\DataSet\FourthSet\HR', 
    'C:\ManduScale\OPScale\DataSet\FourthSet\HR', 
    'C:\ManduScale\OPScale\DataSet\FourthSet\HR', 
    'C:\ManduScale\OPScale\DataSet\FourthSet\HR', 
    'C:\ManduScale\OPScale\DataSet\FourthSet\HR', 
    'C:\ManduScale\OPScale\DataSet\FourthSet\HR',  
    'C:\ManduScale\OPScale\DataSet\FourthSet\HR', 
    'C:\ManduScale\OPScale\DataSet\FourthSet\HR', 
    'C:\ManduScale\OPScale\DataSet\FourthSet\HR', 
    'C:\ManduScale\OPScale\DataSet\FourthSet\HR', 
    'C:\ManduScale\OPScale\DataSet\FourthSet\HR', 
    ]
    dataroot_LR: ['C:\ManduScale\OPScale\DataSet\FourthSet\LR1.lmdb',
    'C:\ManduScale\OPScale\DataSet\FourthSet\LR2.lmdb',
    'C:\ManduScale\OPScale\DataSet\FourthSet\LR3.lmdb',
    'C:\ManduScale\OPScale\DataSet\FourthSet\LR4.lmdb',
    'C:\ManduScale\OPScale\DataSet\FourthSet\LR5.lmdb',
    'C:\ManduScale\OPScale\DataSet\FourthSet\LR6.lmdb',
    'C:\ManduScale\OPScale\DataSet\FourthSet\LR7.lmdb',
    'C:\ManduScale\OPScale\DataSet\FourthSet\LR8.lmdb',
    'C:\ManduScale\OPScale\DataSet\FourthSet\LR9.lmdb',
    'C:\ManduScale\OPScale\DataSet\FourthSet\LR10.lmdb',
    'C:\ManduScale\OPScale\DataSet\FourthSet\LR11.lmdb',
    'C:\ManduScale\OPScale\DataSet\FourthSet\LR12.lmdb',
    'C:\ManduScale\OPScale\DataSet\FourthSet\LR13.lmdb',
    'C:\ManduScale\OPScale\DataSet\FourthSet\LR14.lmdb',
    'C:\ManduScale\OPScale\DataSet\FourthSet\LR15.lmdb',
    'C:\ManduScale\OPScale\DataSet\FourthSet\LR16.lmdb',
    'C:\ManduScale\OPScale\DataSet\FourthSet\LR17.lmdb',
    'C:\ManduScale\OPScale\DataSet\FourthSet\LR18.lmdb',
    'C:\ManduScale\OPScale\DataSet\FourthSet\LR19.lmdb',
    'C:\ManduScale\OPScale\DataSet\FourthSet\LR20.lmdb',
    'C:\ManduScale\OPScale\DataSet\FourthSet\LR22.lmdb',
    'C:\ManduScale\OPScale\DataSet\FourthSet\LR23.lmdb',
    'C:\ManduScale\OPScale\DataSet\FourthSet\LR24.lmdb',
    'C:\ManduScale\OPScale\DataSet\FourthSet\LR25.lmdb',
    ]

anyone can help me fix this issue?

@MHketbi
Copy link
Author

MHketbi commented Jul 21, 2022

i tried

    dataroot_B: ['C:\ManduScale\OPScale\DataSet\FourthSet\HR1\HR1.lmdb',
    'C:\ManduScale\OPScale\DataSet\FourthSet\HR1\HR1.lmdb']
    dataroot_A: ['C:\ManduScale\OPScale\DataSet\FourthSet\LR1\LR1a.lmdb',
    'C:\ManduScale\OPScale\DataSet\FourthSet\LR1\LR1b.lmdb']

and i still game error
AssertionError: C:\ManduScale\OPScale\DataSet\FourthSet\LR1\LR1a.lmdb has no valid image file

@MHketbi
Copy link
Author

MHketbi commented Jul 21, 2022

the only thing that works is specifying 1 HR.lmdb and 1 LR.lmdb and i cant use it like the above example.

can this be fixed?

@victorca25
Copy link
Owner

Hello! When using lmdb, only one lmdb for LR (input) images and one for HR (target) images is supported. Also, when using lmdb, it is only supported if both the LR and HR are a lmdb db.

Technically, it would be possible to have multiple DBs simultaneously, but it adds complexity and doesn't adds benefits during training. In this case I would recommend to create each of the lmdb with all the images that will be used during training, instead of multiple separate ones.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants