liupei101 / DSCA

[ESWA 2023] Implementation of DSCA: A Dual-stream Network with Cross-attention on Whole-Slide Image Pyramids for Cancer Prognosis
22 stars 5 forks source link

关于preset/tcga.csv和prest/new-tcga.csv #3

Closed ljhOfGithub closed 1 year ago

ljhOfGithub commented 1 year ago

您好!我在使用tcga.csv进行patch分割之后,使用了big_to_small.py得到高分辨率的h5文件,但是我之后使用S04.sh时,高分辨率的图片发生了错误:·

Traceback (most recent call last):
  File "/mnt/data0/LI_jihao/mydata/DSCA-main/Pipeline-Processing-TCGA-Slides-for-MIL-main/tools/CLAM/extract_features_fp.py", line 197, in <module>
    output_file_path = compute_w_loader(h5_file_path, output_pt_path, wsi, 
  File "/mnt/data0/LI_jihao/mydata/DSCA-main/Pipeline-Processing-TCGA-Slides-for-MIL-main/tools/CLAM/extract_features_fp.py", line 55, in compute_w_loader
    for count, (batch, coords) in enumerate(loader):
  File "/opt/tljh/user/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 633, in __next__
    data = self._next_data()
  File "/opt/tljh/user/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 677, in _next_data
    data = self._dataset_fetcher.fetch(index)  # may raise StopIteration
  File "/opt/tljh/user/lib/python3.9/site-packages/torch/utils/data/_utils/fetch.py", line 51, in fetch
    data = [self.dataset[idx] for idx in possibly_batched_index]
  File "/opt/tljh/user/lib/python3.9/site-packages/torch/utils/data/_utils/fetch.py", line 51, in <listcomp>
    data = [self.dataset[idx] for idx in possibly_batched_index]
  File "/mnt/data0/LI_jihao/mydata/DSCA-main/Pipeline-Processing-TCGA-Slides-for-MIL-main/tools/CLAM/datasets/dataset_h5.py", line 201, in __getitem__
    img = self.wsi.read_region(coord, self.patch_level, (self.patch_size, self.patch_size)).convert('RGB')
  File "/home/jupyter-ljh/.local/lib/python3.9/site-packages/openslide/__init__.py", line 236, in read_region
    return lowlevel.read_region(
  File "/home/jupyter-ljh/.local/lib/python3.9/site-packages/openslide/lowlevel.py", line 311, in read_region
    _read_region(slide, buf, x, y, level, w, h)
ctypes.ArgumentError: argument 3: <class 'TypeError'>: wrong type

以上问题我已解决,我通过查看openslide/lowlevel.py发现_read_region的类型要求是:[_OpenSlide, POINTER(c_uint32), c_int64, c_int64, c_int32, c_int64, c_int64],所以使用big_to_small.py产生的高分辨率坐标应该转换为int64。