DevoLearn / devolearn

Accelerate data driven research on embryos with deep learning models :microscope:
MIT License
43 stars 31 forks source link

Colab demo requires multiple upgrades #69

Open Mayukhdeb opened 1 year ago

Mayukhdeb commented 1 year ago
  1. Devolearn requires torch==1.7, but I think it would also work with the latest versions of torch. Using the latets version of torch would make the installation much faster on google colab notebooks because the latest version of torch is already installed there.
  2. The URL for the weights to the embryo segmentation model is most likely broken, throws an HTTP error.
  3. arg mode = 'cpu' should be replaced with device = 'cpu'
  4. optionally, we can also let the user decide the GPU ID like device = 'cuda:0'
  5. move the run tests cell to the bottom

Note that this is a beginner friendly issue, all the changes are to be done on this notebook. Feel free to reply to this if you're willing to take this up.

alon1samuel commented 1 year ago

Hi, I've started to take a look on the issues, to help out :) Regarding 1 - Where is the colab notebook? a - I tried to go into Examples notebook - but it took me to nbviewer.org notebook b - I'm seeing in requirements.txt that torch>=1.7 which is fine?

Continuing to check the rest

sushmanthreddy commented 1 year ago

@alon1samuel https://colab.research.google.com/github/DevoLearn/data-science-demos/blob/master/devolearn_docs/devolearn_quickstart.ipynb this is link for the notebook and ,I was also going through the issue and found out main error was coming at "embryo_segmentor "actually ,I found out there was no file named embryo segmentor in the whole devolearn repo , I was still search for this thing, if u found out any leads ..pls let me knew

Mayukhdeb commented 1 year ago

Hi @sushmanthreddy and @alon1samuel 👋 The colab notebook's source code can be found here. Feel free to make a PR there with the fixed notebook.

alon1samuel commented 1 year ago

Thanks guys! I'll take a look @sushmanthreddy @Mayukhdeb

Anantk2908 commented 1 year ago

I think, I have found the root of the problem. While running the "tests" cell. It throws an import error saying it cannot import name 'cell_membrane_segmentor' from 'devolearn' (/usr/local/lib/python3.7/dist-packages/devolearn/__init__.py)

This error can be resolved by releasing a new package on pypi by the admins

image

alon1samuel commented 1 year ago

So if you install the package from github it fixes the problem? I mean if you do pip install git+https://github.com/DevoLearn/devolearn ... ?

Anantk2908 commented 1 year ago

Yeah after trying the command the issue seems to resolved the only thing that remains is that embryo_segmentor is no longer a function that is used in the newer versions of devolearn and it's name has been changed to something else. Can the admins update the same over here so it can be changed.

image

alon1samuel commented 1 year ago

Thanks, I'll check it later. Hopefully create a PR soon

Anantk2908 commented 1 year ago

Hi @sushmanthreddy , If you delete the runtime and re-run the notebook the issue should be fixed. I did the same it worked for me.

sushmanthreddy commented 1 year ago

Hi @sushmanthreddy , If you delete the runtime and re-run the notebook the issue should be fixed. I did the same it worked for me.

thanks for helping out

alon1samuel commented 1 year ago

I've left a PR for the changes on devolearn side. Changes are still needed in the data-science notebook

sushmanthreddy commented 1 year ago

fixed issues 1 ." The URL for the weights to the embryo segmentation model is most likely broken, throws an HTTP error" , I have tried to fix this issue . 2 . arg mode = 'cpu' should be replaced with device = 'cpu' , this has been fixed..

Issues need to be fixed :

1 .optionally, we can also let the user decide the GPU ID like device = 'cuda:0' 2 .move the run tests cell to the bottom..

alon1samuel commented 1 year ago

Thank you! Very nice work

sushmanthreddy commented 1 year ago

@alon1samuel

use this code in run test cell...the path is inappropriate which u were using that is the reason it isn't working

import devolearn
os.path.dirname(devolearn.__file__) + "/" + "tests" + "/" + "test.py"
!python /content/devolearn/devolearn/test

I have closed my pr because it has some incomplete work..and above code snippet works fine just path need to updated correctly

image

And I was encountering another error at installation place..at first code cell.I don't knew what it is! but it seems to look like this...if u find out same issue pls try too resolve it

image
alon1samuel commented 1 year ago

Great! The tests run smoothly, I'll check on my notebook as well.

About your errors it's really weird about these dependencies. For example: I haven't seen tensorflow being needed for the installation. I'll slack you, maybe we can fix this in a huddle.

alon1samuel commented 1 year ago

I've fixed some other stuff in the notebook. Now the tests are failing since 1 file is not showing up. Even after installing devolearn from git by

pip install git+https://github.com/DevoLearn/devolearn.git@master

I'm still getting a message - successfully installed devolearn-0.3.0 (which is weird)

And the file that is missing in the tests is "devolearn/tests/sample_data/images/nucleus_seg_sample.png":

image

Anyone has an idea why id does that?

alon1samuel commented 1 year ago

I've ignored this in the end. Very strange anyway.

alon1samuel commented 1 year ago

I've created a PR with recent changes to notebook on repo

I think the issue can be closed @Mayukhdeb as @Anantk2908 did most of the fixes there in the last MR