Why am I unable to call the "cellpose" function on Linux Platform?

I recently installed MATLAB R2023b and I am trying to run the 'cellpose' function from the 'Medical Imaging Toolbox Interface for Cellpose Library' support package and it gives the following error:

Unable to resolve the name 'py.MWCellposeWrapper.setModelsFolderPath'.
Error in cellpose
I have all the necessary toolboxes required for the 'cellpose' function to work, according to:
https://www.mathworks.com/help/medical-imaging/ref/cellpose.html
I can confirm that the "Medical Imaging Toolbox Interface for Cellpose Library" support package is properly installed by verifying the output of "matlabshared.supportpkg.getInstalled". Running the function 'downloadCellposeModels' from the support package also works.
Why am I still getting this error when I run 'cellpose' on my Linux Machine in MATLAB R2023b ?

 Accepted Answer

The main reason for such errors while running 'cellpose' function is because of running it in OS/Systems with unsupported system requirements. You can find MATLAB R2023b system requirements for Linux in the link attached below
Similarly, you can find system requirements for all OS by selecting the drop down from the above link.
If the version is not compatible, update your OS and see if the issue can be resolved. If your version satisfies the system requirements, please feel to reach out to MathWorks Technical Support and provide the following information.
1) Start MATLAB, capture the full error after executing this:
cellpose
2) Execute the following command and capture the output:
pyenv()
3) Execute the following command and capture the output:
string(py.sys.path)'
4) If the following paths are not listed in the output obtained from the above step, add them using:
insert(py.sys.path, int64(0), "C:\ProgramData\MATLAB\SupportPackages\R2023b\toolbox\medical\supportpackages\cellpose\cellpose\"); insert(py.sys.path, int64(0), "C:\ProgramData\MATLAB\SupportPackages\R2023b\3P.instrset\cellpose.instrset\win64\cellposeModules\")
5) Run this and capture output:
mwpylib = py.importlib.import_module('MWCellposeWrapper')
If this command errors out saying 'ZLIB_{Version}' not found, it is recommended to upgrade the 'zlib' to 1.2.11
6) Capture the output of the command below.
[~, res] = system('echo %PATH%')

More Answers (0)

Categories

Products

Release

R2023b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!