当前位置:网站首页>Setting up Paths
Setting up Paths
2022-07-20 20:14:00 【Cierlly】
Setting up Paths
nnU-Net relies on environment variables to know where raw data, preprocessed data and trained model weights are stored.
To use the full functionality of nnU-Net, the following three environment variables must be set:
nnUNet_raw_data_base: This is where nnU-Net finds the raw data and stored the cropped data. The folder located at
nnUNet_raw_data_base must have at least the subfolder nnUNet_raw_data, which in turn contains one subfolder for each Task.
It is the responsibility of the user to bring the raw data into the appropriate format - nnU-Net will then take care of
the rest For more information on the required raw data format, see here.Example tree structure:
nnUNet_raw_data_base/nnUNet_raw_data/Task002_Heart ├── dataset.json ├── imagesTr │ ├── la_003_0000.nii.gz │ ├── la_004_0000.nii.gz │ ├── ... ├── imagesTs │ ├── la_001_0000.nii.gz │ ├── la_002_0000.nii.gz │ ├── ... └── labelsTr ├── la_003.nii.gz ├── la_004.nii.gz ├── ... nnUNet_raw_data_base/nnUNet_raw_data/Task005_Prostate/ ├── dataset.json ├── imagesTr │ ├── prostate_00_0000.nii.gz │ ├── prostate_00_0001.nii.gz │ ├── ... ├── imagesTs │ ├── prostate_03_0000.nii.gz │ ├── prostate_03_0001.nii.gz │ ├── ... └── labelsTr ├── prostate_00.nii.gz ├── prostate_01.nii.gz ├── ...
nnUNet_preprocessed: This is the folder where the preprocessed data will be saved. The data will also be read from
this folder during training. Therefore it is important that it is located on a drive with low access latency and high
throughput (a regular sata or nvme SSD is sufficient).RESULTS_FOLDER: This specifies where nnU-Net will save the model weights. If pretrained models are downloaded, this
is where it will save them.
How to set environment variables
(nnU-Net was developed for Ubuntu/Linux. The following guide is intended for this operating system and will not work on
others. We do not provide support for other operating systems!)
There are several ways you can do this. The most common one is to set the paths in your .bashrc file, which is located
in your home directory. For me, this file is located at /home/fabian/.bashrc. You can open it with any text editor of
choice. If you do not see the file, that may be because it is hidden by default. You can run ls -al /home/fabian
to
ensure that you see it. In rare cases it may not be present and you can simply create it with touch /home/fabian/.bashrc
.
Once the file is open in a text editor, add the following lines to the bottom:
export nnUNet_raw_data_base="/media/fabian/nnUNet_raw"
export nnUNet_preprocessed="/media/fabian/nnUNet_preprocessed"
export RESULTS_FOLDER="/media/fabian/nnUNet_trained_models"
(of course adapt the paths to your system and remember that nnUNet_preprocessed should be located on an SSD!)
Then save and exit. To be save, make sure to reload the .bashrc by running source /home/fabian/.bashrc
. Reloading
needs only be done on terminal sessions that were already open before you saved the changes. Any new terminal you open
after will have these paths set. You can verify that the paths are set up properly by typing echo $RESULTS_FOLDER
etc and it should print out the correct folder.
An alternative way of setting these paths
The method above sets the paths permanently (until you delete the lines from your .bashrc) on your system. If you wish
to set them only temporarily, you can run the export commands in your terminal:
export nnUNet_raw_data_base="/media/fabian/nnUNet_raw"
export nnUNet_preprocessed="/media/fabian/nnUNet_preprocessed"
export RESULTS_FOLDER="/media/fabian/nnUNet_trained_models"
This will set the paths for the current terminal session only (the variables will be lost if you close the terminal
and need to be reset every time).
Set the path
nnU-Net Rely on environment variables to know the original data , Storage location of preprocessed data and trained model weights .
To use nnU-Net All the functions of , The following three environment variables must be set :
1)nnUNet_raw_data_base:nnU-Net Find the original data here and store the cropped data . This folder is located in
nnUNet_raw_data_base Must have at least subfolders nnUNet_raw_data, This subfolder contains a subfolder for each task .
It is the responsibility of the user to convert the original data into an appropriate format -nnU-Net Will be responsible for
The rest ;-) More information about the required raw data format , Please see the here.
Example tree structure:
```
nnUNet_raw_data_base/nnUNet_raw_data/Task002_Heart
├── dataset.json
├── imagesTr
│ ├── la_003_0000.nii.gz
│ ├── la_004_0000.nii.gz
│ ├── ...
├── imagesTs
│ ├── la_001_0000.nii.gz
│ ├── la_002_0000.nii.gz
│ ├── ...
└── labelsTr
├── la_003.nii.gz
├── la_004.nii.gz
├── ...
nnUNet_raw_data_base/nnUNet_raw_data/Task005_Prostate/
├── dataset.json
├── imagesTr
│ ├── prostate_00_0000.nii.gz
│ ├── prostate_00_0001.nii.gz
│ ├── ...
├── imagesTs
│ ├── prostate_03_0000.nii.gz
│ ├── prostate_03_0001.nii.gz
│ ├── ...
└── labelsTr
├── prostate_00.nii.gz
├── prostate_01.nii.gz
├── ...
```
2)nnUNet_preprocessed: This is the folder where the preprocessed data will be saved . Data will also be transferred from
This folder during training . therefore , It is important to place it on a drive with low access latency and high drive
throughput ( routine sata or nvme SSD enough ).
3)RESULTS_FOLDER: This specifies nnU-Net Where the model weights will be saved . If you download the pre trained model , Then this
Is where it will keep them .
### How to set environment variables
(nnU-Net Is for Ubuntu / Linux Developed . The following guidelines apply to this operating system , Not applicable to the following operating systems :
other . We do not support other operating systems !)
There are several ways to do this . One of the most common methods is in .bashrc Set the path in the file , The file is located at
In your home directory . For me, , This file is located at /home/fabian/.bashrc. You can open it using any of the following text editors
choice . If you can't see the file , It may be because the file is hidden by default . You can run ls -al / home / fabian
Come on
Make sure you see it . In rare cases , It may not exist , You can use “ touch /home/fabian/.bashrc” Simply create it .
After opening the file in a text editor , Add the following line to the bottom :
export nnUNet_raw_data_base="/media/fabian/nnUNet_raw"
export nnUNet_preprocessed="/media/fabian/nnUNet_preprocessed"
export RESULTS_FOLDER="/media/fabian/nnUNet_trained_models"
( Of course , Please adjust the path of the system , And remember nnUNet_preprocessed Should be located in SSD On !)
Then save and exit . To preserve , Please make sure to run source / home / fabian / .bashrc
Reload .bashrc. reinstall
Before saving changes , Just operate on the opened terminal session . Any new terminal you open
These paths will then be set . You can enter echo $ RESULTS_FOLDER
To verify that the path is set correctly .
wait , It should print out the correct folder .
### Another way to set these paths
The above method permanently sets the path on the system ( Until from .bashrc Delete row from ). If you wish
To set them only temporarily , You can run the export command in the terminal :
set nnUNet_raw_data_base="H:\nn\nnUNet_raw_data_base\nnUNet_raw_data"
set nnUNet_preprocessed="H:\nn\nnUNet_preprocessed"
set RESULTS_FOLDER="H:\nn\RESULTS_FOLDER"
This will only set the path of the current terminal session ( If the terminal is turned off , Variables will be lost
And it needs to be reset every time ).
边栏推荐
猜你喜欢
Win11蓝屏代码0x0000001A的解决方法
论文领读|面向机器翻译的多语言预训练技术哪家强?最新进展一睹为快!
气泡水位计的工作原理及注意事项
Solve the problem of daily error reporting of cascader
469-82(62、63、343、96)
Source insight tips
469-82(62、63、343、96)
搭建关键字驱动自动化测试框架
Super long distance networking scheme of fire engine in offshore wind power fire alarm system
解决cascader日常报错问题
随机推荐
TZC 1283: 简单排序 —— 希尔排序
俱乐部+发展历程+心路历程+失败原因+重新上路
【TypeScript 之手册】
《学习的意义》(一)爱情的问题根源,来源于无知
软解码和硬解码
发力5G笔记本市场,闻泰科技加入“鸿鹄计划”
安世半导体管理层拜会闻泰科技和格力电器
Basset: apprendre le Code réglementaire du génome accessible avec un réseau neuronal profond et cohérent
ES流、PES流、PS流和TS流介绍
外表简单内里复杂的功能测试,如何进行?
What about reinstalling win10 system?
golang面试-代码编写题1-14
网络爬虫DIY解决电商数据收集难题
性能优化:SPA单页应用首屏加载速度慢怎么解决?
启牛开通的华泰账户用着安全吗?
STL 笔记(八):容器——list
广和通联合英特尔发布全球版本5G通信模组
ITMS介绍
[concept] Keming's work resnet+ mental journey [detailed] + solving degradation problems + making the network deeper become a reality
使用 Abp.Zero 搭建第三方登录模块(三):网页端开发