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

ERROR (nifti_image_write_hdr_img2): cannot open output file #24

Open
zaabahmad opened this issue Oct 13, 2018 · 11 comments
Open

ERROR (nifti_image_write_hdr_img2): cannot open output file #24

zaabahmad opened this issue Oct 13, 2018 · 11 comments

Comments

@zaabahmad
Copy link

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
Copy link
Author

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
Copy link
Owner

taigw commented Oct 18, 2018

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
Copy link
Author

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
Copy link

TigabuYaya commented Nov 2, 2018

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
Copy link
Owner

taigw commented Dec 3, 2018

@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
Copy link
Owner

taigw commented Dec 3, 2018

@TigabuYaya Have you solved the problem?

@fhenrywells
Copy link

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
Copy link

[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
Copy link

jcai10 commented Jul 22, 2019

For my case, there is no enough disk space.

@JiexiPinkman
Copy link

For my case, there is no enough disk space.

Me Too !!

@Andrescmm
Copy link

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

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

7 participants