BMIRDS / deepslide

Code for the Nature Scientific Reports paper "Pathologist-level classification of histologic patterns on resected lung adenocarcinoma slides with deep neural networks." A sliding window framework for classification of high resolution whole-slide images, often microscopy or histopathology images.

Home Page:https://www.nature.com/articles/s41598-019-40041-7

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

4_test.py error when using patch-based preprocessed dataset

c25kenneth opened this issue · comments

Hello,

I'm trying to use this framework to train a classification model with my own patch-based preprocessed dataset. In other words, the patches were created without Deepslide. The model training works fine. However, whenever I try to run the 4_test.py file, I get the following error:

f"{','.join([xy[0], xy[1], f'{class_num_to_class[test_preds[i].data.item()]}', f'{confidences[i].data.item():.5f}'])}\n"
IndexError: list index out of range

I tried my own debugging method and I found that xy[1] is empty.

My train_folder has the following file structure:

train_folder

  • train
    • class1
      • patch1
      • patch2
    • class2
      • patch1
      • patch2
      • ...
  • val
    • class1
      • patch1
      • patch2
    • class2
      • patch1
      • patch2
      • ...

My patches_eval_val and patches_eval_test folders have the following structure:

  • patches_eval_val
    • Slide1
      • Slide1
        • patch1
        • patch2
        • ...

After commenting out the line that gives the out of range error, I found that the preds_test and preds_val CSV files contain empty columns and rows
x,y,prediction,confidence

This is the exact folder structure I used when using using Deepslide for patch generation and it worked fine. However, when I try to use my own patches, I get this error. Are there any solutions to this?

@jasonwei20 also, how where do I put the test set?

Stale issue message