You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
If the CELLPOSE_LOCAL_MODELS_PATH is set to the current working directory (cwd), then the model is downloaded properly but the size model fails to download and leads to a FileNotFoundError. This can be a problem in a Nextflow environment where staging happens locally.
Note that this problem occurs whether or not the model is downloaded, but the download step for the CellposeModel does execute properly, just not the SizeModel.
This is due to the os.path.exists(model_type) line here, which only checks the cwd and thus evaluates to True, skipping the caching for the size file in the else clause.
To Reproduce
importosfrompathlibimportPath# Set path to cwd to replicate Nextflow work diros.environ["CELLPOSE_LOCAL_MODELS_PATH"] =str(Path.cwd())
fromcellposeimportmodelscp_model=models.Cellpose(model_type="cyto3")
Probably need to add another check there for whether the associated size npy file exists, or you may prefer another way!
The text was updated successfully, but these errors were encountered:
Describe the bug
If the
CELLPOSE_LOCAL_MODELS_PATH
is set to the current working directory (cwd), then the model is downloaded properly but the size model fails to download and leads to aFileNotFoundError
. This can be a problem in a Nextflow environment where staging happens locally.Note that this problem occurs whether or not the model is downloaded, but the download step for the
CellposeModel
does execute properly, just not theSizeModel
.This is due to the
os.path.exists(model_type)
line here, which only checks the cwd and thus evaluates toTrue
, skipping the caching for the size file in theelse
clause.To Reproduce
Probably need to add another check there for whether the associated size
npy
file exists, or you may prefer another way!The text was updated successfully, but these errors were encountered: