Project-MONAI / tutorials

MONAI Tutorials
https://monai.io/started.html
Apache License 2.0
1.87k stars 683 forks source link

Update tcia prostatex model notebook #1852

Open kirbyju opened 1 month ago

kirbyju commented 1 month ago

Description

Fixed dependency issues with itkwidgets

review-notebook-app[bot] commented 1 month ago

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

KumoLiu commented 1 month ago

Looks the notebook still can not pass the premerge. https://github.com/Project-MONAI/tutorials/actions/runs/11241293887/job/31252532094?pr=1852

kirbyju commented 1 month ago

Looks the notebook still can not pass the premerge. https://github.com/Project-MONAI/tutorials/actions/runs/11241293887/job/31252532094?pr=1852

I'm not sure what the issue is. I can run the notebook end to end in both Colab and Sagemaker Studio Lab without any problems other than these reported dependency issues that don't seem to affect the rest of the notebook:

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
jupyter-events 0.5.0 requires jsonschema[format-nongpl]>=4.3.0, but you have jsonschema 3.2.0 which is incompatible.
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
pydicom-seg 0.4.0 requires jsonschema<4.0.0,>=3.2.0, but you have jsonschema 4.23.0 which is incompatible.
thewtex commented 1 month ago

Just an observation, it looks like CI is timing out (the limit is 6 hours):

image

KumoLiu commented 1 month ago

Just an observation, it looks like CI is timing out (the limit is 6 hours):

Yes, but the main reason here is that it hangs at specific cell since the whole notebook don't take over 6 hours to run.

kirbyju commented 1 month ago

Just an observation, it looks like CI is timing out (the limit is 6 hours):

Yes, but the main reason here is that it hangs at specific cell since the whole notebook don't take over 6 hours to run.

I just saw this in the middle of the report:

Running ./model_zoo/TCIA_PROSTATEx_Prostate_MRI_Anatomy_Model.ipynb
Checking PEP8 compliance...
stdin:78:1: F401 'sys' imported but unused
import sys
^
stdin:102:1: E303 too many blank lines (3)
# + [markdown] id="oYxvN-rebvwG"  # noqa: E501
^
Error: Try running with autofixes: --autofix.

Check failed!

I don't understand why it's complaining about sys not being used. I guess it doesn't pick it up properly when calling it like this for all the installations?

!{sys.executable}

I changed it back to just say "python" instead and removed the extra blank lines.

kirbyju commented 1 month ago

I'm out of ideas in terms of fixing whatever is still causing this last check to fail.

KumoLiu commented 1 month ago

Can you try fix the version to 1.0a23? From what I tested last time, I find this version will not hang. But the latest version will hang.

kirbyju commented 1 month ago

That was already part of the requested changes. It's trying to use 1.0a53 in the most recent commits:

!python -m pip install --upgrade -q \"itkwidgets[all]==1.0a53\" imjoy_elfinder

I tried removing the image ouputs from the imjoy plugin to see if maybe that was the issue.

ericspod commented 1 month ago

I attempted to run this notebook on a headless machine that we have for CICD. I found that the view cell just before "6. MONAI Model Inference" runs quickly but produces no view window, only messages about removing duplicate codecs. No other cell after running this will ever complete, so something changes when this is run to break the interpreter. This is with itkwidgets[all]==1.0a53.

I also found that requests needs to be explicitly installed when creating a fresh conda environment.