Fix - Cellpose2D notebook - Variables not defined #338
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I am creating a pull request that solves some issues that I have been experiencing when using the Cellpose 2D notebook with the pretrained models.
Reproducibility
To reproduce the errors, run sections 1-2 and then move to section 5 to assess the quality of the pretrained models. I am using the pretrained model
Cytoplasm3
with my own data.Problem
Some variables were not defined when jumping from sections 1-2 to section 5 to use the more recent pretrained models (e.g.
Cytoplasm3
). Without these modifications, this raised the following error when loading theCytoplasm3
model.Solution
I have changed the variable name
model_choice
toQC_model
as for the other models.Problem
Similarly, in section 5, some of the models (e.g.
TissueNet
) defined the variablechannels
which requiredsegment_channel
andnuclear_channel
to be defined.Solution
Since
channels
is not required in this cell and would be overwritten in section 5.2, I have removed the definition ofchannels
.Problem
Lastly, some of the models (e.g.
Cytoplasm3
) did not include the defaultQC_model_folder
andQC_model_name
which raised an error when creating the output folder.Solution
I have added the default
QC_model_folder
andQC_model_name
to every model. This solves the issue.Hopefully this helps!
Cheers!