Separate data config for different splits
See original GitHub issueSubject 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:
- Created 3 years ago
- Comments:6 (6 by maintainers)
Top GitHub Comments
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.
Yes, this new config unlocks more options.
Bug fix or new feature, it’s just different names 😂