HenriquesLab / HenriquesLab/ZeroCostDL4Mic

Cellpose 2 - Evaluate your model and generate predictions issues

Open
#314 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Jupyter Notebook
Stars
652
Forks
144
PR merge metrics
No merged PRs in 30d

Description

Hi,

I have trained a model based on the cyto 2 model.

When I tried to evaluate the new model with Use_the_current_trained_model: checked. I assumed it does not need any additional info, but this failed. So I filled the options of:
If not, indicate which model you want to assess: own model
If using your own model, please provide the path to the model (not the folder): - I gave the path to the pdf generated after
training the model.
This still produced an error:

IndexError Traceback (most recent call last)
in <cell line: 17>()
19 list_files = sorted([i for i in os.listdir(model_path+"/"+model_name) if not i.endswith('.pdf')])
20
---> 21 QC_model_path = model_path+"/"+model_name+"/"+list_files[0]
22 QC_model = "Own_model"
23

IndexError: list index out of range

Also, in the section Generate prediction(s) from unseen dataset (2D and 2D + t data). I get the error:

UnpicklingError Traceback (most recent call last)
in <cell line: 103>()
103 if model_choice == "Own_model":
104 channels=[segment_channel,nuclear_channel]
--> 105 model = models.CellposeModel(gpu=True, pretrained_model=Prediction_model)
106
107 print("Own model enabled")

3 frames
/usr/local/lib/python3.10/dist-packages/torch/serialization.py in _legacy_load(f, map_location, pickle_module, **pickle_load_args)
1256 "functionality.")
1257
-> 1258 magic_number = pickle_module.load(f, **pickle_load_args)
1259 if magic_number != MAGIC_NUMBER:
1260 raise RuntimeError("Invalid magic number; corrupt file?")

UnpicklingError: invalid load key, '%'.

Thanks!
Yael

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the evaluation and prediction notebook sections, especially the cells around QC_model_path and CellposeModel(...). Inspect how the model-path inputs are interpreted and which trained-model artifact each workflow expects. Done means both evaluation and prediction complete without the reported IndexError or UnpicklingError.

Written by the indexing model from the issue text.

Assessment

Tech stack
jupyter-notebook, python, pytorch
Domain
machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.