BiomedSciAI / fuse-med-ml

A python framework accelerating ML based discovery in the medical field by encouraging code reuse. Batteries included :)
Apache License 2.0
137 stars 34 forks source link

Update hello_world.ipynb example #278

Closed simona-rc closed 1 year ago

simona-rc commented 1 year ago

I encountered problems with the hello_world notebook version: fuse-med-ml/examples/fuse_examples/imaging/hello_world/hello_world.ipynb

The problems/fixes I encountered: (1) Need to add prefix examples. to fuse_examples.imaging.hello_world.hello_world_utils import LeNet, perform_softmax (2) Need to add prefix model. to model_outputs=["logits.classification", "output.classification"] (3) When running: results = evaluator.eval(ids=None, data=os.path.join(paths["inference_dir"], eval_common_params["infer_filename"]), metrics=metrics, output_dir=paths["eval_dir"],) I got: ImportError: cannot import name '_png' from 'matplotlib' (/usr/local/lib/python3.8/dist-packages/matplotlib/init.py)

Thanks!

SagiPolaczek commented 1 year ago

Thanks @simona-rc 😄

So after investigating the problems I have some conclusions:

  1. Apparently there is an issue in Google Colab with installing python packages manually (like we do with pip install -e ./examples . The solution is annoying as we need to restart the runtime in order to make it run.. The following imports fuse.<blabla> and examples.fuse_examples.<blabla> works due to the local path.
  2. Nice catch! Fixed :) (this is why we need to unit-test the notebook!)
  3. After fixing the installation part that error disappeared as well. I suspect that solving the first problem solved that too.

I addressed those problems in #275 . Currently waiting for #277 to be merged first.

🦜

mapogota commented 1 year ago

Running the Hello world colab notebook produces the following error: "pip._vendor.packaging.requirements.InvalidRequirement: Parse error at "'[all+exa'": Expected string_end"

Same problem if I try to install using Option 2: pip install fuse-med-ml[all+examples]

SagiPolaczek commented 1 year ago

Running the Hello world colab notebook produces the following error: "pip._vendor.packaging.requirements.InvalidRequirement: Parse error at "'[all+exa'": Expected string_end"

Same problem if I try to install using Option 2: pip install fuse-med-ml[all+examples]

Hey @mapogota ! Thank you for reaching out!

I addressed this issue in #275 , soon to be merged ☺️

In the meanwhile please consider visiting this version and/or using:

pip install fuse-med-ml[all,examples]

to install from PyPI.