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

How to train the model with custom datasets #50

Open
Elmiar0642 opened this issue Feb 14, 2023 · 1 comment
Open

How to train the model with custom datasets #50

Elmiar0642 opened this issue Feb 14, 2023 · 1 comment

Comments

@Elmiar0642
Copy link

I wish to use ADNI 3D MRI dataset. I saw training script. Idk how to modify it for custom datasets, especially like ADNI.

I just wish to normally create a model object and then train the model with the 3D images I have inside a directory. I just need to visualise the feature maps at each unit.

@mdraw
Copy link
Member

mdraw commented Feb 14, 2023

If you want to use another dataset there are in principle two ways to proceed:

  • Adapt the dataset to elektronn3's expected format for data loading (usually HDF5 files of the same layout as the ones you can find in the example data), so you can replace the data set in the train_unet_neurodata.py example with it.
  • Or use/write custom data loading code for your dataset. It just should be a subclass of torch.utils.data.Dataset and return a dict that contains an 'inp' key for input data as np.float32 and a 'target' key for target (label) data as np.int64 arrays if you want to train for classification. Everything else can be freely chosen. Then you can replace the reference to PatchCreator in the example script by your own Dataset class.

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

2 participants