- Set the environment variables manually after the "cellpose" function is called.
- Use a custom bash script to set the variables, ensuring that they do not affect MATLAB directly.
How do I resolve a Python error when using the Cellpose library from the "Medical Imaging Toolbox Interface for Cellpose Library" support package with MATLAB R2024a on Ubuntu 24.04?
I am using the 'cellpose' library from the 'Medical Imaging Toolbox Interface for Cellpose Library' support package in MATLAB R2024a on a Linux machine with Ubuntu 24.04. I am also using the "mail" command from Linux to send email notifications about the status of my script.
Reproduction steps:
1. Use the "cellpose" function and "blockImage" to load an image.
2. Use the "mail" command to send the status of the scripts, setting a couple of environment variables programmatically as shown below:
if ~contains(ckMailAddr, '/usr/lib/x86_64-linux-gnu/libstdc++.so.6')
setenv('LD_LIBRARY_PATH', '/usr/lib/x86_64-linux-gnu');
setenv('LD_PRELOAD', '/usr/lib/x86_64-linux-gnu/libstdc++.so.6');
end
3. Finally, use the "apply" function on the image, which results in the following error stack when executing the script in parallel:
>> rethrow(e)
Warning: Unable to load Python object. Saving (serializing) Python objects into a MAT-file is not supported.
Warning: Unable to load Python object. Saving (serializing) Python objects into a MAT-file is not supported.
Error using parallel.FevalFuture/fetchNext
The function evaluation completed with an error.
Error in blockedImage/applyInParallelOverBlocks (line 2429)
%fetchNext(obj.Futures);
Error in blockedImage/applyCore (line 2384)
obj.applyInParallelOverBlocks(bimds, usrFcn, outputs, updateWaitBarFcn,....
Error in blockedlmage/apply (line 389)
[oneCallOutputs{:}] = obj.applyCore(usrFcn, params);
Error in oir2im2stats (line 50)
[bstats , bcount] = apply(bim, ...
Error in DAPICounting_Recursive_FINAL (line 258)
[count,stats,im,img0bj,errorCount] = oir2im2stats(currDir, cp, import, ...
Error in run (line 112)
evalin('caller', strcat(scriptStem, ';'));
Caused by:
Error using MWCellposeWrapper>runmodel (line 60)
Python Error: AttributeError: 'array.array' object has no attribute 'eval'
How can I resolve this issue?
采纳的回答
0 个评论
更多回答(0 个)
另请参阅
类别
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!