Melon-Xu / TopoSemiSeg

The official implementation of "Semi-supervised Segmentation of Histopathology Images with Noise-Aware Topological Consistency".
5 stars 0 forks source link

AttributeError: module 'crisper' has no attribute 'computePH' #2

Open ObstaclseShi opened 1 month ago

ObstaclseShi commented 1 month ago

Thank you for your reply! You are doing a fantastic job there! I have encountered another problem which says module 'crisper' has no attribute 'computePH'. I have searched for any reason online but can't find any. Can you kindly help me? Any information is welcome!

Here is my traceback.

Traceback (most recent call last): File "D:\Pycharm\PyCharm 2021.1.1\plugins\python\helpers\pydev\pydevd.py", line 1483, in _exec pydev_imports.execfile(file, globals, locals) # execute the script File "D:\Pycharm\PyCharm 2021.1.1\plugins\python\helpers\pydev_pydev_imps_pydev_execfile.py", line 18, in execfile exec(compile(contents+"\n", file, 'exec'), glob, loc) File "K:/swk/HSSF/HSSF-main5-toploss/train.py", line 333, in net_list,optimizer_clients = local_semi_surprised_learning(args, net_list, optimizer_clients, \ File "K:/swk/HSSF/HSSF-main5-toploss/train.py", line 88, in local_semi_surprised_learning top_loss = top_criterion(s_mask,w_mask) File "G:\Anaconda\envs\FedFMS\lib\site-packages\torch\nn\modules\module.py", line 1511, in _wrapped_call_impl return self._call_impl(*args, *kwargs) File "G:\Anaconda\envs\FedFMS\lib\site-packages\torch\nn\modules\module.py", line 1520, in _call_impl return forward_call(args, **kwargs) File "K:\swk\HSSF\HSSF-main5-toploss\utils\topo_consistency_loss.py", line 26, in forward topo_loss += getTopoLoss(lh, gt) File "K:\swk\HSSF\HSSF-main5-toploss\utils\topo_consistency_loss.py", line 130, in getTopoLoss pd_lh, bcp_lh, dcp_lh, pairs_lh_pa, valid_idx_lh, noisy_idx_lh = getCriticalPoints_cr(lh_patch, threshold=pd_threshold) File "K:\swk\HSSF\HSSF-main5-toploss\utils\topo_consistency_loss.py", line 34, in getCriticalPoints_cr pd = cr.computePH(lh, maxdim=1, location="birth") AttributeError: module 'crisper' has no attribute 'computePH' python-BaseException

Process finished with exit code -1

I try to build my environment by conda create -n Topeloss python=3.9.12 conda install pytorch==2.0.1 torchvision==0.15.2 torchaudio==2.0.2 pytorch-cuda=11.7 -c pytorch -c nvidia pip install –r requirements.txt

And some other packages for my own usage. I don't know whether it would uncover your package. pip install tensorboard pip install opencv-python

Melon-Xu commented 1 month ago

Thank you for your interest to our work. It seems that you use 'crisper' library. I have modified the requirements.txt to install cripser, not crisper. 'cripser' has the attribute 'computePH'.

If you have any questions, feel free to let me know.

ObstaclseShi commented 1 month ago

Thank you for your interest to our work. It seems that you use 'crisper' library. I have modified the requirements.txt to install cripser, not crisper. 'cripser' has the attribute 'computePH'.

If you have any questions, feel free to let me know.

Hello, I have met another issue says that cannot import name 'mplDeprecation' from 'matplotlib._api.deprecation'. I tried to upgrade the matplotlib package but it didn't help.

K:/swk/HSSF/HSSF-main5-toploss/train.py:4: UserWarning: The NumPy module was reloaded (imported a second time). This can in some cases result in small but subtle issues and is discouraged. import numpy as np Traceback (most recent call last): File "", line 1007, in _find_and_load File "", line 986, in _find_and_load_unlocked File "", line 680, in _load_unlocked File "", line 850, in exec_module File "", line 228, in _call_with_frames_removed File "K:\swk\HSSF\HSSF-main5-toploss\utils\losses.py", line 12, in from utils.topo_consistency_loss import TopoLoss File "K:\swk\HSSF\HSSF-main5-toploss\utils\topo_consistency_loss.py", line 3, in from pylab import File "G:\Anaconda\envs\Topeloss\lib\site-packages\pylab.py", line 1, in from matplotlib.pylab import # noqa: F401, F403 File "G:\Anaconda\envs\Topeloss\lib\site-packages\matplotlib__init__.py", line 159, in from . import _api, _version, cbook, _docstring, rcsetup File "G:\Anaconda\envs\Topeloss\lib\site-packages\matplotlib\cbook__init__.py", line 32, in from matplotlib._api.deprecation import ( ImportError: cannot import name 'mplDeprecation' from 'matplotlib._api.deprecation' (G:\Anaconda\envs\Topeloss\lib\site-packages\matplotlib_api\deprecation.py) python-BaseException

Melon-Xu commented 1 month ago

It's likely due to version incompatibility or a corrupted installation. You can first check your matplotlib version and then re-download or upgrade the matplotlib library.