HenriquesLab / ZeroCostDL4Mic

ZeroCostDL4Mic: A Google Colab based no-cost toolbox to explore Deep-Learning in Microscopy
MIT License
566 stars 130 forks source link

Label-free prediction (fnet) 2D error when setting training parameters #192

Open HuiZhang0 opened 2 years ago

HuiZhang0 commented 2 years ago

Hello, I tried to train a model using Label-free prediction (fnet) 2D notebook but was faced with one error as shown in the photo. image

Thanks Hui Zhang

esgomezm commented 2 years ago

Dear @HuiZhang0 Can you please try it now and see if it works? Thank you!

nrsid commented 4 months ago

Hi, I have many errors coming up. The first one is:

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. torchdata 0.7.1 requires torch>=2, but you have torch 1.11.0+cu113 which is incompatible. torchtext 0.17.1 requires torch==2.2.1, but you have torch 1.11.0+cu113 which is incompatible.

Is this a serious issue? Thank you, Siddharth

IvanHCenalmor commented 4 months ago

Dear @nrsid,

First of all, thank you very much for using fnet_2D. Sorry for the error you are getting, seems like there is a problems with the packages versions. Not a serious problem in principle, but it may create some issues so is better to fix it. I have a version of the fnet_2D notebook, where after testing, seems that this problem is solved.

As you say that you are encountering many errors, I have uploaded it to copy of the ZeroCostDL4Mic repository on my profile. Like this, we can fix as many issues as we want in this repository and update the final working version to the official ZeroCostDL4Mic repository ๐Ÿค— Here it is the link to the updated notebook on Colab ๐Ÿ‘‰ https://colab.research.google.com/github/IvanHCenalmor/ZeroCostDL4Mic/blob/7d5af6d1835112c52a631435252b4574b2ae81d3/Colab_notebooks/fnet_2D_ZeroCostDL4Mic.ipynb

Please try to use that notebook and tell us if previous issue is also solved for you. Also, it would be amazing if you can continue using the notebook and giving us feedback of any problem you encounter or if everything is correctly working.

When we are sure that everything is perfectly running we can update the updated version on the official ZeroCostDL4Mic repository so that everyone can continue using it and will also help to fix its version on DL4MicEveryhwere.

Thank you very much Siddharth for all your feedback! ๐Ÿค—

Please keep us updated of how does it work! Ivรกn

nrsid commented 4 months ago

Hi Ivan,

Many thanks for your help with issue. The error with 1.1 seems to be fixed. But while running 1.3 I get another error namely:


AttributeError Traceback (most recent call last) in <cell line: 60>() 58 import shutil 59 from tempfile import mkstemp ---> 60 from skimage.metrics import structural_similarity 61 from skimage.metrics import peak_signal_noise_ratio as psnr 62 from skimage import img_as_float32

2 frames /usr/local/lib/python3.10/dist-packages/skimage/_shared/utils.py in copy_func(f, name) 195 196 """ --> 197 return types.FunctionType(f.code, f.globals, name or f.name, 198 f.defaults, f.closure) 199

AttributeError: 'numpy._ArrayFunctionDispatcher' object has no attribute 'code'

Can you kindly suggest solution for this problem?

Thank you, Siddharth

IvanHCenalmor commented 4 months ago

Hi @nrsid again,

Sorry, it was my fault, seems like I didn't totally fix the dependencies issue. I have updated the notebook, now seems like all he dependencies should be correctly installed and working.

NOTICE: I hope you will get an output similar to this. There will be some "ERROR", but they are not really important:

Found existing installation: albumentations 1.4.11
Uninstalling albumentations-1.4.11:
  Successfully uninstalled albumentations-1.4.11
Found existing installation: chex 0.1.86
Uninstalling chex-0.1.86:
  Successfully uninstalled chex-0.1.86
Found existing installation: pandas-stubs 2.0.3.230814
Uninstalling pandas-stubs-2.0.3.230814:
  Successfully uninstalled pandas-stubs-2.0.3.230814
Found existing installation: tensorflow 2.15.0
Uninstalling tensorflow-2.15.0:
  Successfully uninstalled tensorflow-2.15.0
Found existing installation: dopamine_rl 4.0.9
Uninstalling dopamine_rl-4.0.9:
  Successfully uninstalled dopamine_rl-4.0.9
Found existing installation: optax 0.2.2
Uninstalling optax-0.2.2:
  Successfully uninstalled optax-0.2.2
Found existing installation: flax 0.8.4
Uninstalling flax-0.8.4:
  Successfully uninstalled flax-0.8.4
Requirement already satisfied: pip in /usr/local/lib/python3.10/dist-packages (24.1.2)
Collecting pip
  Downloading pip-24.2-py3-none-any.whl.metadata (3.6 kB)
Downloading pip-24.2-py3-none-any.whl (1.8 MB)
   โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ” 1.8/1.8 MB 30.5 MB/s eta 0:00:00
Installing collected packages: pip
  Attempting uninstall: pip
    Found existing installation: pip 24.1.2
    Uninstalling pip-24.1.2:
      Successfully uninstalled pip-24.1.2
Successfully installed pip-24.2
   โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ” 17.0/17.0 MB 117.8 MB/s eta 0:00:00
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.
xgboost 2.1.0 requires nvidia-nccl-cu12; platform_system == "Linux" and platform_machine != "aarch64", which is not installed.
albucore 0.0.12 requires numpy<2,>=1.24.4, but you have numpy 1.23.0 which is incompatible.
   โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ” 43.9/43.9 MB 63.1 MB/s eta 0:00:00
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.
xgboost 2.1.0 requires nvidia-nccl-cu12; platform_system == "Linux" and platform_machine != "aarch64", which is not installed.
     โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ” 28.9/28.9 MB 102.6 MB/s eta 0:00:00
  Preparing metadata (setup.py) ... done
   โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ” 4.5/4.5 MB 107.2 MB/s eta 0:00:00
  Building wheel for scikit-image (setup.py) ... done
   โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ” 9.6/9.6 MB 115.3 MB/s eta 0:00:00
     โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ” 1.6/1.6 GB 21.3 MB/s eta 0:00:00
     โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ” 22.3/22.3 MB 160.4 MB/s eta 0:00:00
     โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ” 2.9/2.9 MB 110.4 MB/s eta 0:00:00
   โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ” 10.4/10.4 MB 91.4 MB/s eta 0:00:00

NOTICE: also, after running the 1.1. it will "crash", there is an automatic restarting to ensure that the installations are correctly applied. After this, you should go to section 1.2. and not run the section 1.1. again. (I have removed the previous section 1.2. and now the 1.3. is the 1.2.).

Apart from that, I have been cleaning a little bit more the code, so I hope this time everything goes right.

Here it is the latest version of the notebook: https://colab.research.google.com/github/IvanHCenalmor/ZeroCostDL4Mic/blob/63c47d76158d5f68f3fbf738807152795a8a9142/Colab_notebooks/fnet_2D_ZeroCostDL4Mic.ipynb#scrollTo=btZhzA1oswmW

Please continue giving us feedback on how everything goes! ๐Ÿค—

Thank you, Ivรกn