Closed qianjiangcn closed 5 years ago
Hi! This is likely because you haven't changed the histogram_ref_file
. Please refer to this stack overflow post https://stackoverflow.com/questions/46831160/niftynet-indices-are-out-of-bounds-error and this section of the read the docs https://niftynet.readthedocs.io/en/dev/config_spec.html#histogram-ref-file for more information
Hi! This is likely because you haven't changed the
histogram_ref_file
. Please refer to this stack overflow post https://stackoverflow.com/questions/46831160/niftynet-indices-are-out-of-bounds-error and this section of the read the docs https://niftynet.readthedocs.io/en/dev/config_spec.html#histogram-ref-file for more information
Hi, thank you very much for your answer. Yes I did not change the histogram_ref_file and it seems to generate a new one by ''normalisation histogram training |----------| 2.8%'' And I am still not sure how to set up the normalisation_file? Should I write a txt file indicating number of labels ? I referred to the config file and there has not been much information. Thank you very much!
Hi there,
Apologies for the confusion: First of all, make sure that num_classes
is set in the [SEGMENTATION]
section of the config file to however many classes are present in your images (e.g. 2 for binary segmentation).
After this, run the network. If it crashes after the histogram training, look at the last two lines of histogram training. Make sure the label-from
and label-to
are set correctly. For example, in this example I've taken from BRaTS, I've mapped label 4.0 to 3 to make the labels sequential.
[name-of-label-field]_label-from 0.0 1.0 2.0 4.0
[name-of-label-field]_label-to 0 1 2 3
Does this help?
If there isn't any more action on this I will close it.
I have been running into the error trying to use niftynet highRes2Dnet to perform 3D segmentation:
InvalidArgumentError (see above for traceback): Provided indices are out-of-bounds w.r.t. dense side with broadcasted shape [[{{node worker_0/loss_function/map/while/mul}} = SparseDenseCwiseMul[T=DT_FLOAT, _class=["loc:@worke...tackPushV2"], _device="/job:localhost/replica:0/task:0/device:CPU:0"](worker_0/loss_function/map/while/SparseReshape, worker_0/loss_function/map/while/ones_like, worker_0/loss_function/map/while/SparseReshape:1, worker_0/loss_function/map/while/Softmax)]]
As one issue stated, this could happen when the largest voxel value in the discrete segmentation maps is greater than num_classes in the config file. what do you mean largest voxel value in the discrete segmentation maps? my spatial window is 32 and the num_classes in the config is 160. Here is the config info and the size of input data is 128256256