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

Error "same number of tiles in inputs and target" #91

Closed
toren77 opened this issue Jul 22, 2018 · 1 comment
Closed

Error "same number of tiles in inputs and target" #91

toren77 opened this issue Jul 22, 2018 · 1 comment

Comments

@toren77
Copy link

toren77 commented Jul 22, 2018

robosat$ ./rs train --model config/model-unet.toml --dataset config/dataset-buildings-dar-es-salam.toml

len(inputs)= 60859
len(inputs[0].tiles)= 60859
target.tiles[0]= (Tile(x=638131, y=543981, z=20), 'data/dar-es-salam-buldings-dataset/training/labels/20/638131/543981.png')
len(target)= 60859

len(inputs)= 7798
len(inputs[0].tiles)= 7798
target.tiles[0]= (Tile(x=638131, y=544010, z=20), 'data/dar-es-salam-buldings-dataset/validation/labels/20/638131/544010.png')
len(target)= 8453

Traceback (most recent call last):
File "/anaconda3/envs/robosat/lib/python3.6/runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "/anaconda3/envs/robosat/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/robosat/robosat/tools/main.py", line 57, in
args.func(args)
File "/robosat/robosat/tools/train.py", line 73, in main
train_loader, val_loader = get_dataset_loaders(model, dataset)
File "/robosat/robosat/tools/train.py", line 201, in get_dataset_loaders
[os.path.join(path, "validation", "images")], os.path.join(path, "validation", "labels"), transform
File "/robosat/robosat/datasets.py", line 62, in init
assert len(self.target) == len(self.inputs[0]), "same number of tiles in inputs and target"
AssertionError: same number of tiles in inputs and target

@daniel-j-h
Copy link
Collaborator

The number of tiles in your slippy map directory with images has to be the same number of tiles with corresponding masks. This has to hold for both the training as well as validation dataset.

Quick check e.g. via

find dataset/training/images -type f | wc -l
find dataset/training/labels -type f | wc -l

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