-
Notifications
You must be signed in to change notification settings - Fork 117
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 in prediction sample code #98
Comments
Hey @bhralzz, mhm looks like you have some problems in the data loading process. Can you verify that you downloaded the KITS19 dataset correctly?
I would also refer to our KiTS19 example JupyterNotebook: https://github.com/frankkramer-lab/MIScnn/blob/master/examples/KiTS19.ipynb If running
on the Data IO object, you should obtain the indices of all samples. If not, the dataset was not correctly downloaded or the path to the directory is incorrect. Cheers, |
Dear Dominik, Yes, all data samples downloaded correctly. |
Hey @bhralzz, please attach your code and complete error log. The KiTS19 Jupyter Notebook is a fully functional example for the complete KiTS19 dataset. The best solution would be if you attach an Google Colab Notebook with this error for reproducing this bug. From the ValueException you posted I strongly suspect that something is incorrect in the data folder or during data loading. Batches & predictions are generated in separated folders. Having a look on your complete code & error message will get things clearer. I'm optimistic that we are get your kits19 MIScnn instance running! Cheers, |
simply just put this code beside miscnn source code : from miscnn import * pp = Preprocessor(data_io, batch_size=4, analysis="patchwise-crop", from miscnn.neural_network.architecture.unet.standard import Architecture sample_list = data_io.get_indiceslist() pred = model.predict(sample_list[0], return_output=True) # error produced in this mode but below without error should we pass sample_list in list mode even single sample? |
Hey @bhralzz, the samples should be passed as a list. Concerning the error message: Did you already fixed it? Cheers, |
Hi
Dear Dominik
The network test code has been tested as below just on 3 sample case from kits:
**from miscnn import *
Create a Data I/O interface for kidney tumor CT scans in NIfTI format
from miscnn.data_loading.interfaces import NIFTI_interface
interface = NIFTI_interface(pattern="case_000[0-9]*", channels=1, classes=3)
Initialize data path and create the Data I/O instance
data_path = "dataset_temp/"
data_io = Data_IO(interface, data_path)
Create a Preprocessor instance to configure how to preprocess the data into batches
pp = Preprocessor(data_io, batch_size=4, analysis="patchwise-crop",
patch_shape=(80,160,160))
Create a deep learning neural network model with a standard U-Net architecture
from miscnn.neural_network.architecture.unet.standard import Architecture
unet_standard = Architecture()
model = Neural_Network(preprocessor=pp, architecture=unet_standard)
Training the model with 3samples for 5epochs
sample_list = data_io.get_indiceslist()
model.train(sample_list[0:2], epochs=5)
Predict the segmentation for samples
pred = model.predict(sample_list[2], return_output=True)
but the final output presented as below:
1/1 [==============================] - 40s 40s/step - loss: 2.4510 - dice_soft: 0.1830
Epoch 2/5
1/1 [==============================] - 23s 23s/step - loss: 2.4692 - dice_soft: 0.1769
Epoch 3/5
1/1 [==============================] - 28s 28s/step - loss: 2.4522 - dice_soft: 0.1826
Epoch 4/5
1/1 [==============================] - 19s 19s/step - loss: 2.4147 - dice_soft: 0.1951
Epoch 5/5
1/1 [==============================] - 27s 27s/step - loss: 2.4354 - dice_soft: 0.1882**
.
.
.
.
ValueError: Image could not be found "dataset_temp/c"
could you please check this?
The text was updated successfully, but these errors were encountered: