taigw / brats17

Brain tumor segmentation for MICCAI 2017 BraTS challenge
BSD 3-Clause "New" or "Revised" License
321 stars 130 forks source link

ERROR (nifti_image_write_hdr_img2): cannot open output file #24

Open zaabahmad opened 5 years ago

zaabahmad commented 5 years ago

Hello Everyone, I'm facing this error right now..

INFO:niftynet: Restoring parameters from model17/msnet_en32sg_20000.ckpt INFO:niftynet: Restoring parameters from model17/msnet_en32cr_20000.ckpt Data load, 100.0% finished ERROR (nifti_image_write_hdr_img2): cannot open output file '/result17/HGG/Brats17_CBICA_ATX_1.nii.gz' HGG/Brats17_CBICA_ATX_1 ERROR (nifti_image_write_hdr_img2): cannot open output file '/result17/HGG/Brats17_CBICA_AXN_1.nii.gz' HGG/Brats17_CBICA_AXN_1 test time 124.04104340076447 Traceback (most recent call last): File "test.py", line 460, in test(config_file) File "test.py", line 450, in test np.savetxt(save_folder + '/test_time.txt', test_time) File "/home/zaaba/anaconda3/lib/python3.6/site-packages/numpy/lib/npyio.py", line 1307, in savetxt open(fname, 'wt').close() FileNotFoundError: [Errno 2] No such file or directory: '/result17/test_time.txt'

Sorry if this error is a newbie mistake... :(

zaabahmad commented 5 years ago

Changes that i make is on the data_root path and save_folder path as below...

data_root = /home/zaaba/anaconda3/brats17-master/Brats17TrainingData save_folder = /home/zaaba/anaconda3/brats17-master/Brats17TrainingData/result17 data_names = config17/test_names_temp.txt

taigw commented 5 years ago

Hi zaabahmad, Can you make sure the output dir exists? You need to create that dir manually as the code does not create it automatically.

zaabahmad commented 5 years ago

Hi taigw, Thank you for responding. The output dir did exists as i have manually create it. As below configuration. data_root = /home/zaaba/anaconda3/brats17-master/Brats17TrainingData save_folder = /home/zaaba/anaconda3/brats17-master/Brats17TrainingData/result17 data_names = config17/test_names_temp.txt

should i change it to this instead?

data_root = /home/zaaba/anaconda3/brats17-master/Brats17TrainingData save_folder = /home/zaaba/anaconda3/brats17-master/Brats17TrainingData/result17 data_names = /home/zaaba/anaconda3/brats17-master/config17/test_names_temp.txt

TigabuYaya commented 5 years ago

I got the same error, if you have fixed it the bug, can you please tell me the way how to correct this error?

taigw commented 5 years ago

@zaabahmad In your first question, it seems that you were trying to save the data to ''/result17". I guess you intended to save it in "./result17".

taigw commented 5 years ago

@TigabuYaya Have you solved the problem?

fhenrywells commented 5 years ago

I'm having this same problem when trying to write my output data:

** ERROR (nifti_image_write_hdr_img2): cannot open output file 'result18/HGG/Brats18_CBICA_ATX_1.nii.gz'

My test_all_class.txt file reference scheme is the same as your example in config17.

fhenrywells commented 5 years ago

[Resolved]: You have to make the directory containing HGG/LGG results programmatically before writing to this directory in save_array_as_nifty_volume(..) in data_process.py

jcai10 commented 5 years ago

For my case, there is no enough disk space.

JiexiPinkman commented 4 years ago

For my case, there is no enough disk space.

Me Too !!

Andrescmm commented 1 year ago

You have to make the directory containing HGG/LGG results programmatically before writing to this directory in save_array_as_nifty_volume(..) in data_process.py

how? help please