MIC-DKFZ / HD-BET

MRI brain extraction tool
Apache License 2.0
262 stars 63 forks source link

error running bet-hd on cpu #1

Closed zeydabadi closed 5 years ago

zeydabadi commented 5 years ago

Hi, I followed the installation instructions on a Dell Laptop without GPU. The OS is Linux 4.15.0-45-generic x86_64. I am receiving the following error:

mahmoud@Latitude:~/HD-BET$ hd-bet -i ~/data/10942/data_MNI.nii.gz -o ~/data/10942/data2_HD_BET.nii.gz -device cpu -mode fast -tta 0

######################## If you are using hd-bet, please cite the following paper: Isensee F, Schell M, Tursunova I, Brugnara G, Bonekamp D, Neuberger U, Wick A, Schlemmer HP, Heiland S, Wick W,Bendszus M, Maier-Hein KH, Kickingereder P. Automated brain extraction of multi-sequence MRI using artificialneural networks. arXiv preprint arXiv:1901.11341, 2019. ########################

File: /home/mahmoud/data/10942/data_MNI.nii.gz preprocessing... Traceback (most recent call last): File "/home/mahmoud/anaconda3/bin/hd-bet", line 6, in exec(compile(open(file).read(), file, 'exec')) File "/home/mahmoud/HD-BET/HD_BET/hd-bet", line 119, in run_hd_bet(input_files, output_files, mode, config_file, device, pp, tta, save_mask, overwrite_existing) File "/home/mahmoud/HD-BET/HD_BET/run.py", line 83, in run_hd_bet data, data_dict = load_and_preprocess(in_fname) File "/home/mahmoud/HD-BET/HD_BET/data_loading.py", line 46, in load_and_preprocess images[k] = preprocess_image(images[k], is_seg=False, spacing_target=(1.5, 1.5, 1.5)) File "/home/mahmoud/HD-BET/HD_BET/data_loading.py", line 21, in preprocess_image image = resize_image(image, spacing, spacing_target).astype(np.float32) File "/home/mahmoud/HD-BET/HD_BET/data_loading.py", line 10, in resize_image return resize(image, new_shape, order=order, mode='edge', cval=0, anti_aliasing=False) TypeError: resize() got an unexpected keyword argument 'anti_aliasing'

FabianIsensee commented 5 years ago

Hi, your skimage version is too old. Run pip install --upgrade scikit-image and then try again =) Best, Fabian

zeydabadi commented 5 years ago

Hi Fabian, Did that upgrade and now I get this with no image output:

mahmoud@Latitude:~/HD-BET$ hd-bet -i ~/data/10942/data_MNI.nii.gz -o ~/data/10942/data2_HD_BET.nii.gz -device cpu -mode fast -tta 0

######################## If you are using hd-bet, please cite the following paper: Isensee F, Schell M, Tursunova I, Brugnara G, Bonekamp D, Neuberger U, Wick A, Schlemmer HP, Heiland S, Wick W,Bendszus M, Maier-Hein KH, Kickingereder P. Automated brain extraction of multi-sequence MRI using artificialneural networks. arXiv preprint arXiv:1901.11341, 2019. ########################

File: /home/mahmoud/data/10942/data_MNI.nii.gz preprocessing... image shape after preprocessing: (171, 160, 111) prediction (CNN id)... 0 Killed

FabianIsensee commented 5 years ago

How much RAM do you have? That sounds like the process was killed because it used up too much. Pytorch needs a lot of RAM, probably around 32GB

zeydabadi commented 5 years ago

Only 8GB

FabianIsensee commented 5 years ago

I just tested it. Regardles of how many threads I set for pytorch it will use 12.6GB for an image of size (103, 141, 141). Yours is larger at (171, 160, 111) and will need ~20GB of RAM. On a GPU your image will need ~4.5GB. If you have one that would probably be the best way to use hd-bet anyways. I am afraid I cannot help you as this is beyond my reach (it's pytorch that uses all the memory). Best, Fabian