fuscc-deep-path / sc_MTOP

sc-MTOP is an analysis framework based on deep learning and computational pathology. This framework aims to characterize the tumor ecosystem diversity at the single-cell level. This code provide 1) Hover-Net-based nuclear segmentation and classification; 2) Nuclear morphological and texture feature extraction; 3) Multi-level pairwise nuclear graph construction and spatial topological feature extraction.
27 stars 6 forks source link

F3_FeatureExtract.py #6

Open AllenSpike opened 9 months ago

AllenSpike commented 9 months ago

Perform feature extraction commands on my own data and get a confusing error.

(scMTOP) spike@local:~/0_project/0_ESCC/0_sc_MTOP$ python main.py feature --json_path="/home/spike/0_project/0_ESCC/data/output/json/160887001.json" --wsi_path="/home/spike/0_project/0_ESCC/data/wsi_he/160887001.ndpi" --output_path="/home/spike/0_project/0_ESCC/data/output/feature"
{'json_path': '/home/spike/0_project/0_ESCC/data/output/json/160887001.json', 'wsi_path': '/home/spike/0_project/0_ESCC/data/wsi_he/160887001.ndpi', 'output_path': '/home/spike/0_project/0_ESCC/data/output/feature', 'xml_path': 'None'}
*********Loading json*********
*****Total 9 steps: 0 ~ 8*****
0. Preparing: 100%|████████████████████████████████████████████████████████████████████████████| 359106/359106 [00:07<00:00, 46634.16it/s]
Getting morph features
##########morph features cost###########, **111.36**
Getting GLCM features
###########GLCM features cost###########, **422.31**
Getting T-T graph feature
---Creating edges
---Getting DisKnn features
---Getting GraphCenter features
100%|███████████████████████████████████████████████████████████████████████████████████████████████| 8746/8746 [00:10<00:00, 829.87it/s]
Getting I-I graph feature
---Creating edges
---Getting DisKnn features
---Getting GraphCenter features
100%|████████████████████████████████████████████████████████████████████████████████████████████| 14921/14921 [00:11<00:00, 1306.57it/s]
Getting S-S graph feature
---Creating edges
Fatal error at src/core/vector.c:466 : Assertion failed: capacity >= 0
已放弃 (核心已转储)
(scMTOP) spike@local:~/0_project/0_ESCC/0_sc_MTOP$ /home/spike/anaconda3/envs/scMTOP/lib/python3.9/multiprocessing/resource_tracker.py:216: UserWarning: resource_tracker: There appear to be 1 leaked semaphore objects to clean up at shutdown
  warnings.warn('resource_tracker: There appear to be %d '

It seems like memory leakage problem, so I tried to modified the ‘process_n’ argument in the 'WSIGraph.py' from 8 to 4, but it does not work. How should i troubleshoot this error?

CDPDisk commented 8 months ago

I apologize for not addressing your issue promptly. It seems that we haven't encountered the issue in our data, so I cannot provide a definitive answer. Perhaps this problem stems from the package being used. Based on my speculation, it could be due to the generation of a subgraph with an excessively large number of vertices, leading to this issue. You may consider adjusting the thresholds or other parameters during the graph construction process to limit the size of the generated graph and see if the same problem persists.

Caesar6666666 commented 1 week ago

Have you solved this problem?

Perform feature extraction commands on my own data and get a confusing error.

(scMTOP) spike@local:~/0_project/0_ESCC/0_sc_MTOP$ python main.py feature --json_path="/home/spike/0_project/0_ESCC/data/output/json/160887001.json" --wsi_path="/home/spike/0_project/0_ESCC/data/wsi_he/160887001.ndpi" --output_path="/home/spike/0_project/0_ESCC/data/output/feature"
{'json_path': '/home/spike/0_project/0_ESCC/data/output/json/160887001.json', 'wsi_path': '/home/spike/0_project/0_ESCC/data/wsi_he/160887001.ndpi', 'output_path': '/home/spike/0_project/0_ESCC/data/output/feature', 'xml_path': 'None'}
*********Loading json*********
*****Total 9 steps: 0 ~ 8*****
0. Preparing: 100%|████████████████████████████████████████████████████████████████████████████| 359106/359106 [00:07<00:00, 46634.16it/s]
Getting morph features
##########morph features cost###########, **111.36**
Getting GLCM features
###########GLCM features cost###########, **422.31**
Getting T-T graph feature
---Creating edges
---Getting DisKnn features
---Getting GraphCenter features
100%|███████████████████████████████████████████████████████████████████████████████████████████████| 8746/8746 [00:10<00:00, 829.87it/s]
Getting I-I graph feature
---Creating edges
---Getting DisKnn features
---Getting GraphCenter features
100%|████████████████████████████████████████████████████████████████████████████████████████████| 14921/14921 [00:11<00:00, 1306.57it/s]
Getting S-S graph feature
---Creating edges
Fatal error at src/core/vector.c:466 : Assertion failed: capacity >= 0
已放弃 (核心已转储)
(scMTOP) spike@local:~/0_project/0_ESCC/0_sc_MTOP$ /home/spike/anaconda3/envs/scMTOP/lib/python3.9/multiprocessing/resource_tracker.py:216: UserWarning: resource_tracker: There appear to be 1 leaked semaphore objects to clean up at shutdown
  warnings.warn('resource_tracker: There appear to be %d '

It seems like memory leakage problem, so I tried to modified the ‘process_n’ argument in the 'WSIGraph.py' from 8 to 4, but it does not work. How should i troubleshoot this error?