devolearn icon indicating copy to clipboard operation
devolearn copied to clipboard

Colab demo requires multiple upgrades

Open Mayukhdeb opened this issue 3 years ago • 18 comments

  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.

Mayukhdeb avatar Aug 10 '22 08:08 Mayukhdeb

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

alon1samuel avatar Aug 15 '22 22:08 alon1samuel

@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

sushmanthreddy avatar Aug 16 '22 06:08 sushmanthreddy

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.

Mayukhdeb avatar Aug 16 '22 07:08 Mayukhdeb

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

alon1samuel avatar Aug 16 '22 08:08 alon1samuel

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

Anantk2908 avatar Aug 16 '22 10:08 Anantk2908

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 ... ?

alon1samuel avatar Aug 16 '22 11:08 alon1samuel

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

Anantk2908 avatar Aug 16 '22 11:08 Anantk2908

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

alon1samuel avatar Aug 16 '22 11:08 alon1samuel

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.

Anantk2908 avatar Aug 16 '22 20:08 Anantk2908

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

sushmanthreddy avatar Aug 16 '22 20:08 sushmanthreddy

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

alon1samuel avatar Aug 23 '22 13:08 alon1samuel

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..

sushmanthreddy avatar Aug 23 '22 15:08 sushmanthreddy

Thank you! Very nice work

alon1samuel avatar Aug 23 '22 18:08 alon1samuel

@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

sushmanthreddy avatar Aug 23 '22 19:08 sushmanthreddy

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 avatar Aug 23 '22 22:08 alon1samuel

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 avatar Sep 05 '22 09:09 alon1samuel

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

alon1samuel avatar Sep 05 '22 22:09 alon1samuel

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

alon1samuel avatar Sep 05 '22 22:09 alon1samuel