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

RuntimeError: Could not find a dataset with the ID 101. #2405

Closed
Hesham2016 opened this issue Jul 29, 2024 · 7 comments
Closed

RuntimeError: Could not find a dataset with the ID 101. #2405

Hesham2016 opened this issue Jul 29, 2024 · 7 comments
Assignees

Comments

@Hesham2016
Copy link

Hesham2016 commented Jul 29, 2024

I'm using nnUNetv2 to segment brain tumor MRI data. Unfortunately, my data is not public, so you won't be able to reproduce the error. I have created a Docker image of nnUNetv2, and it is working fine. I have also prepared the dataset in the nnUNetv2 format and set up the correct directories for nnUNet_raw, nnUNet_preprocessed, and nnUNet_results.

Here is the structure:

Inside nnUNet_raw, I have a folder named Dataset101_BTS.
Within Dataset101_BTS, there are imagesTr, imagesTs, labelsTr, and dataset.json.
I followed the nnUNetv2 formatting guidelines when preparing the data and the dataset.json file.

dataset.json file:

{
"channel_names": {
"0": "T1ce"
},
"labels": {
"background": 0,
"brain": 1,
"GTV": 2,
},
"numTraining": 40,
"file_ending": ".nii.gz"
}

I got the error when running the following command.

ha_2456@user:/app$ nnUNetv2_plan_and_preprocess -d 101 --verify_dataset_integrity -c 3d_fullres
Fingerprint extraction...
Traceback (most recent call last):
File "/home/ha_2456/.local/bin/nnUNetv2_plan_and_preprocess", line 33, in
sys.exit(load_entry_point('nnunetv2', 'console_scripts', 'nnUNetv2_plan_and_preprocess')())
File "/app/nnUNet_v2/nnunetv2/experiment_planning/plan_and_preprocess_entrypoints.py", line 184, in plan_and_preprocess_entry
extract_fingerprints(args.d, args.fpe, args.npfp, args.verify_dataset_integrity, args.clean, args.verbose)
File "/app/nnUNet_v2/nnunetv2/experiment_planning/plan_and_preprocess_api.py", line 47, in extract_fingerprints
extract_fingerprint_dataset(d, fingerprint_extractor_class, num_processes, check_dataset_integrity, clean,
File "/app/nnUNet_v2/nnunetv2/experiment_planning/plan_and_preprocess_api.py", line 26, in extract_fingerprint_dataset
dataset_name = convert_id_to_dataset_name(dataset_id)
File "/app/nnUNet_v2/nnunetv2/utilities/dataset_name_id_conversion.py", line 48, in convert_id_to_dataset_name
raise RuntimeError(f"Could not find a dataset with the ID {dataset_id}. Make sure the requested dataset ID "
RuntimeError: Could not find a dataset with the ID 101. Make sure the requested dataset ID exists and that nnU-Net knows where raw and preprocessed data are located (see Documentation - Installation). Here are your currently defined folders:
nnUNet_preprocessed=/user/projects/brainTumor/nnunet_workspace/nnUNet_preprocessed
nnUNet_results=/user/projects/brainTumor/nnunet_workspace/nnunet_workspace/nnUNet_results
nnUNet_raw=/user/projects/brainTumor/nnunet_workspace/nnunet_workspace/nnUNet_raw
If something is not right, adapt your environment variables.

Thank you very much

@GregorKoehler
Copy link

Hi @Hesham2016 ,

can you double-check if your paths are set correctly and that the dataset is present in the respective directory?
If so, I don't see why nnUNet doesn't find the dataset. For reference, here's the utility where the datasets are found from the ID:

def find_candidate_datasets(dataset_id: int):
startswith = "Dataset%03.0d" % dataset_id
if nnUNet_preprocessed is not None and isdir(nnUNet_preprocessed):
candidates_preprocessed = subdirs(nnUNet_preprocessed, prefix=startswith, join=False)
else:
candidates_preprocessed = []
if nnUNet_raw is not None and isdir(nnUNet_raw):
candidates_raw = subdirs(nnUNet_raw, prefix=startswith, join=False)
else:
candidates_raw = []
candidates_trained_models = []
if nnUNet_results is not None and isdir(nnUNet_results):
candidates_trained_models += subdirs(nnUNet_results, prefix=startswith, join=False)
all_candidates = candidates_preprocessed + candidates_raw + candidates_trained_models
unique_candidates = np.unique(all_candidates)
return unique_candidates

@scott-huberty
Copy link

@GregorKoehler can you elaborate on what you mean by the "paths are set correctly" and the "dataset is present in the respective directory" ?

I'm hitting this same issue, I'm trying to do my due diligence by reading all the nnUNet documentation, but I'm several hours into debugging this and a hint would be really appreciated 🙏

@scott-huberty
Copy link

Update: For me the issue was that my user account did not have permissions to access the Model folders (see DCAN-Labs/BIBSnet#134 ).

I am not sure if it's feasible but maybe nnUNet can provide a more informative error for these cases. If so, I may be able to help on that front if I have enough time.

@GregorKoehler
Copy link

Due to this issue being stale for a while, I'll close it for now. Feel free to re-open if you still face this issue.

@scott-huberty : I'm glad you could resolve your issue! Concerning providing more informative error messages, I'm not sure how one would provide this level of information and I'm afraid this might be out of scope for this repository as this particular problem lies more on the user's dataset setup (and here access).

@scott-huberty
Copy link

@GregorKoehler Makes sense.. But given that multiple people have reported the issue. Maybe we can add something to the docs/common issues section?

@feng-ye00
Copy link

I encountered the same problem, how did you solve it?

@scott-huberty
Copy link

scott-huberty commented Nov 4, 2024

@feng-ye00 I am not a developer on this project but it might be worth opening a new issue, and linking to this issue (by doing #2405 ). In the newly created issue you should share the command you are running and the error stack trace.

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

4 participants