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

Using stardist-conic without pip install #250

Open
ajinkya-kulkarni opened this issue Sep 17, 2023 · 6 comments
Open

Using stardist-conic without pip install #250

ajinkya-kulkarni opened this issue Sep 17, 2023 · 6 comments

Comments

@ajinkya-kulkarni
Copy link
Contributor

Hello team, I was trying to try out the conic model (https://github.com/stardist/stardist/tree/conic-2022/examples/conic-2022) on my custom dataset. I tried several times installing the conic branch using pip install. I was wondering if I can simply use the conic branch without a pip install. Like locally importing the necessary libraries after downloading the code.

Thanks!

@ajinkya-kulkarni ajinkya-kulkarni changed the title Using StarDist without pip install Using StarDist - conic without pip install Sep 18, 2023
@ajinkya-kulkarni ajinkya-kulkarni changed the title Using StarDist - conic without pip install Using stardist-conic without pip install Sep 18, 2023
@uschmidt83
Copy link
Member

Unfortunately, I don't think this will work since we also changed the C++ code in the conic-2022 branch. I.e. if you first install the "normal" StarDist (pip install stardist) and then "replace" StarDist's Python source code files with those from the conic-2022 branch, the post-processing will throw an error (or not work correctly).

Did you read the troubleshooting section?

@ajinkya-kulkarni
Copy link
Contributor Author

Yes, I read the troubleshooting section as well. This is how I tried to install the conic branch:

conda create stardist-conic python=3.9 followed by brew install gcc and then CC=gcc-10 CXX=g++-10 pip install git+https://github.com/stardist/stardist.git@conic-2022.
But this gives an error and the installation stops. Am I doing anything wrong? I am using a macbook, but I get the same error on a Ubuntu machine.

@uschmidt83
Copy link
Member

conda create stardist-conic python=3.9 followed by brew install gcc and then CC=gcc-10 CXX=g++-10 pip install git+https://github.com/stardist/stardist.git@conic-2022.

On my Mac, brew install gcc tries to install gcc version 13, i.e. gcc-10 / g++-10 have to be changed to gcc-13 / g++-13. You can install a specific gcc version like this: brew install gcc@13. (The same applies to linux.)

This might work:

brew install gcc@13
conda create stardist-conic python=3.9
# ...
conda activate stardist-conic
CC=gcc-13 CXX=g++-13 pip install git+https://github.com/stardist/stardist.git@conic-2022

But this gives an error and the installation stops.

It would have been helpful to see the error message.

I am using a macbook

Despite what I wrote above, compiling on Mac might also work without installing gcc first. I.e. try this:

brew install libomp  # optional to speed up some computations
conda create stardist-conic python=3.9
# ...
conda activate stardist-conic
pip install git+https://github.com/stardist/stardist.git@conic-2022

@ajinkya-kulkarni
Copy link
Contributor Author

Thanks, I will try your approach now. In the meantime, is there a way you can share the conic trained model, so it will be easier for me to test it on custom HE image?

@ajinkya-kulkarni
Copy link
Contributor Author

Hello @uschmidt83, I was able to pip install the conic branch on a Ubuntu machine, but only the CPU version. The training for 1000 epochs as mentioned in the train notebook would roughly take one month to complete on my CPU workstation.
It would therefore be great if you could share/upload the trained model as well, as I can test it out on my colon HE images, instead of waiting for a month for the training to finish.

Best, Ajinkya

@maweigert
Copy link
Member

The training for 1000 epochs as mentioned in the train notebook would roughly take one month to complete on my CPU workstation.

There seems to be a problem with tensorflow not recognizing your GPU. You can check this with

tf.test.is_gpu_available()

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

3 participants