taigw / brats17

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

Test - ERROR: cannot open output file #10

Closed apopli closed 6 years ago

apopli commented 6 years ago

@taigw When I run following command python test.py config17/test_all_class.txt

I face the following error: 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 16.6796910763 Traceback (most recent call last): File "test.py", line 459, in <module> test(config_file) File "test.py", line 449, in test np.savetxt(save_folder + '/test_time.txt', test_time) File "/usr/local/lib/python2.7/dist-packages/numpy/lib/npyio.py", line 1307, in savetxt open(fname, 'wt').close() IOError: [Errno 2] No such file or directory: 'result17/test_time.txt'

Could you please suggest the solution.

cb632482135qq commented 6 years ago

Maybe you can solve the problem by creating the folder, below is my solution ( I test 2015 data , similar to 2017).

-- brats17-master -------- data --------------- BRATS2015_Training --------------- BRATS2015_Validation --------------- result15 ---------------------- HGG ---------------------- LGG --------------- ... -------- config15 -------- config17 -------- model15 -------- model17 -------- ...

"data" "result15" " HGG" "LGG" folder are necessary , but code doesn't create automatically!

Then, don't forget to check or change the path in test.py and test_all_class.txt.

It will be exciting if what I mention will help you !

apopli commented 6 years ago

@cb632482135qq The test worked after setting up the folder structure as you mentioned. Thanks a lot for your help!