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

Setting up nobrainer and training models #24

Open
hvgazula opened this issue Jul 9, 2024 · 3 comments
Open

Setting up nobrainer and training models #24

hvgazula opened this issue Jul 9, 2024 · 3 comments

Comments

@hvgazula
Copy link
Contributor

hvgazula commented Jul 9, 2024

@dhritimandas I opened an issue here to discuss any roadblocks you may be facing.

@hvgazula
Copy link
Contributor Author

Just an fyi, I just added a skeleton training script for brainsiam at https://github.com/neuronets/nobrainer_training_scripts/blob/main/1.2.0/scripts/train/brainsiam_train.py

Notice that while the code shows using a Segmentation class, it is not a segmentation model. So, we need to write a custom training (aka fit) script. It should be straightforward and I will take a stab at it. I hope this use case will enable us to come up with a more generic fit class or at least instructions on how to write a custom training loop inside nobrainer (which in reality is no different from how it is done in tf/keras).

PS: if this isn't clear, don't bother. I will explain when we meet next.

@hvgazula
Copy link
Contributor Author

hvgazula commented Aug 22, 2024

# installation instructions
conda create -n nobrainer-dev "python<3.12" -y
git clone https://github.com/neuronets/nobrainer
cd nobrainer
pip install -e .

@hvgazula
Copy link
Contributor Author

Thanks for the clarification. It worked fine until I ran into the following error. I have python 3.12 and tensorflow 2.16 installed (the latest one that comes with pip install tensorflow). Do I need to downgrade tf (as the setup.cfg file has this listed as tensorflow<2.16)?
image

@dhritimandas The official TF docs recommend python 3.8-3.11. So, if you notice the installation instructions, I set "python<3.12" and that will take care of the correct tf version for nobrainer. TF>=2.16 moved to keras 3.0 which will fail with some functions in nobrainer. I hope this helps.

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

1 participant