question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Separate data config for different splits

See original GitHub issue

Subject of the issue

When predict with config labeled=true, without providing label files, error raised: WARNING:root:sample_label is not used in predict. It is True if and only if mode == ‘train’. WARNING:root:Using customized configuration.The code might break if the config doesn’t match the saved model. 2021-02-02 19:58:43.570942: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library ‘libcuda.so.1’; dlerror: libcuda.so.1: cannot open shared object file: No such file or directory 2021-02-02 19:58:43.570972: W tensorflow/stream_executor/cuda/cuda_driver.cc:312] failed call to cuInit: UNKNOWN ERROR (303) 2021-02-02 19:58:43.570986: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:156] kernel driver does not appear to be running on this host (precision7750-yhu): /proc/driver/nvidia/version does not exist Traceback (most recent call last): File “demos/paired_ct_lung/demo_predict.py”, line 59, in <module> config_path=config_path, File “/home/yipenghu/git/DeepReg/deepreg/predict.py”, line 238, in predict repeat=False, File “/home/yipenghu/git/DeepReg/deepreg/util.py”, line 42, in build_dataset data_loader = get_data_loader(dataset_config, mode) File “/home/yipenghu/git/DeepReg/deepreg/dataset/load.py”, line 47, in get_data_loader config=data_loader_config, default_args=default_args File “/home/yipenghu/git/DeepReg/deepreg/registry.py”, line 262, in build_data_loader category=DATA_LOADER_CLASS, config=config, default_args=default_args File “/home/yipenghu/git/DeepReg/deepreg/registry.py”, line 141, in build_from_config return cls(**args) File “/home/yipenghu/git/DeepReg/deepreg/dataset/loader/paired_loader.py”, line 71, in init dir_paths=data_dir_paths, name=“moving_labels”, grouped=False File “/home/yipenghu/git/DeepReg/deepreg/dataset/loader/nifti_loader.py”, line 40, in init self.set_data_structure() File “/home/yipenghu/git/DeepReg/deepreg/dataset/loader/nifti_loader.py”, line 65, in set_data_structure ), f"directory {named_dir_path} does not exist" AssertionError: directory demos/paired_ct_lung/dataset/test/moving_labels does not exist

Your environment

  • DeepReg version bd3202ace94151d657c3daf9c49ce06563fdc556

  • OS: Ubuntu 20.04

  • Python Version: 3.7

  • TensorFlow

    • TensorFlow Version 2.3

Steps to reproduce

remove fixed_labels and moving_labels in dataset/test folder of the demo, e.g. paired_ct_lung

run python demos/paired_ct_lung/demo_predict.py

Expected behaviour

It should allow prediction without any labels

Actual behaviour

1- It only allows prediction when the config key changed to “false” - this is a confusing behaviour as the labeled key should only control the training.

2- When debugging, the docstring isn’t clear: L163 in network.py: it is not clear when labels are not provided, if the labels should be “None” or else.

3- double check: The availability of the labels should not affect the model output.

@mathpluscode can you have a look.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
mathpluscodecommented, Apr 12, 2021

I will limit this issue as config change, then decouple the train/predict in a separate issue, so that we do not modify 100 files at a time.

0reactions
mathpluscodecommented, Mar 7, 2021

I’m now working on this issue.

So the reality is that, we may have different availabilities of labels for

  • train/valid
  • test

I can see two options

  1. For prediction script, we can overwrite labeled flag using flags.
  2. Or alternatively, we need to change data config as
dataset:
  train:
    dir: "data/test/nifti/unpaired/train" # required
    labeled: true
  valid:
    dir: "data/test/nifti/unpaired/train" # required
    labeled: true
  test:
    dir: "data/test/nifti/unpaired/train" # required
    labeled: false

We can even allow mixed format like nifit/h5 in the future.

@YipengHu what do u think?

I prefer the “new” config. It is clearer. And I insist to deal with this as a bug fix as the current can be ambiguous. What do you think?

Yes, this new config unlocks more options.

Bug fix or new feature, it’s just different names 😂

Read more comments on GitHub >

github_iconTop Results From Across the Web

Better support multiple splits which introduce changes to the ...
Case A - independent splits: Two splits can split the same config and are expected to work if only one of them is...
Read more >
List splits and configurations - Hugging Face
A split is a subset of the dataset, like train and test , that are used during different stages of training and evaluating...
Read more >
How to… Split data fields - Preppin' Data
Simply choose the data field you want to split, go and find the '...' icon, select, 'Split Values' and then 'Automatic Split' and...
Read more >
How to Split Unmanageable Data Sets | Built In
One solution is learning how to automatically split your data sets into separate files so each data file becomes a manageable amount of ......
Read more >
Using Config Split to Split Your Config Across Environments ...
Speaker: Josh Fabean Drupal 8 brings us config in yml files. This is great for deploying changes to your site without having to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found