Amshaker / unetr_plus_plus

[IEEE TMI-2024] UNETR++: Delving into Efficient and Accurate 3D Medical Image Segmentation
Apache License 2.0
360 stars 34 forks source link

No module named 'unetr_pp' #12

Closed MOMOANNIE closed 1 year ago

MOMOANNIE commented 1 year ago

Hello, when I run the script run_training.py, this happens, what is going on? path is ok image

Amshaker commented 1 year ago

Hello,

You have to run it from the main directory path of the repository:

Similar to this command: python unetr_pp/run/run_training.py 3d_fullres unetr_pp_trainer_synapse 2 0

MOMOANNIE commented 1 year ago

Hello,

You have to run it from the main directory path of the repository:

Similar to this command: python unetr_pp/run/run_training.py 3d_fullres unetr_pp_trainer_synapse 2 0

I run it from the main directory, and it still reports an error. I try these two commands, but they don’t work. python unetr_plus_plus/unetr_pp/run/run_training.pypython unetr_pp/run/run_training.py

The error as follows: image

image

Amshaker commented 1 year ago

There is a problem with your folder structure.

Please trace it.

Here, unetr_pp is this folder : https://github.com/Amshaker/unetr_plus_plus/tree/main/unetr_pp

The error says that there is no folder called unetr_pp. It is probably from your folder structure.

Amshaker commented 1 year ago

Hi @MOMOANNIE,

Please make sure to run the training from the provided training script in the repo "run_training_synapse.sh"

You can't just run the python file as there are the following variables you must set before running the training script:

DATASET_PATH=DATASET

export PYTHONPATH=./
export RESULTS_FOLDER=output_synapse_UNETR_GitHub
export unetr_pp_preprocessed="$DATASET_PATH"/unetr_pp_raw/unetr_pp_raw_data/Task02_Synapse
export unetr_pp_raw_data_base="$DATASET_PATH"/unetr_pp_raw

python unetr_pp/run/run_training.py 3d_fullres unetr_pp_trainer_synapse 2 0
MOMOANNIE commented 1 year ago

Hi @MOMOANNIE,

Please make sure to run the training from the provided training script in the repo "run_training_synapse.sh"

You can't just run the python file as there are the following variables you must set before running the training script:

DATASET_PATH=DATASET

export PYTHONPATH=./
export RESULTS_FOLDER=output_synapse_UNETR_GitHub
export unetr_pp_preprocessed="$DATASET_PATH"/unetr_pp_raw/unetr_pp_raw_data/Task02_Synapse
export unetr_pp_raw_data_base="$DATASET_PATH"/unetr_pp_raw

python unetr_pp/run/run_training.py 3d_fullres unetr_pp_trainer_synapse 2 0

Ok thank you, after running run_training_synapse.sh, there is another problem, as follows: with open(file, mode) as f: FileNotFoundError: [Errno 2] No such file or directory: '/home/project/DATASET/unetr_pp_preprocessed/Task032/unetr_pp_Plansv2.1_plans_3D.pkl'

This is because I did not preprocess my data. If it is my own data, how should I preprocess it?

Amshaker commented 1 year ago

You should do it in the same way as nnFormer setting up the datasets.

4dirveduck commented 9 months ago

Hello, I had the same problem, my folder structure is similarity with https://github.com/Amshaker/unetr_plus_plus/tree/main/unetr_pp
and i'm running the training script:"bash training_scripts/run_training_synapse.sh ", the problem still exists. Can you help me to solv the problem? 111 222