nyukat / GMIC

An interpretable classifier for high-resolution breast cancer screening images utilizing weakly supervised localization
https://doi.org/10.1016/j.media.2020.101908
GNU Affero General Public License v3.0
168 stars 48 forks source link

Potential issue in patch map display #23

Closed taijizhao closed 2 years ago

taijizhao commented 2 years ago

First congratulations for the great project! I tried to run the run.sh file with the --visualization-flag on, the resulting patch maps were always aligned to the left border of the image and do not correspond to the activated regions in the heat maps. image

image

image

I haven't figured out if this is a problem only in the visualization or it also affects the prediction accuracy. Thank you very much!

taijizhao commented 2 years ago

Moreover, when I use MODEL_INDEX='4' to run the inference, it returns the following error: Stage 1: Crop Mammograms Error: the directory to save cropped images already exists. Stage 2: Extract Centers Stage 3: Run Classifier 0%| | 0/4 [00:00<?, ?it/s] Traceback (most recent call last): File "src/scripts/run_model.py", line 302, in <module> main() File "src/scripts/run_model.py", line 292, in main start_experiment( File "src/scripts/run_model.py", line 255, in start_experiment output_df = run_single_model(single_model_path, data_path, parameters, turn_on_visualization) File "src/scripts/run_model.py", line 220, in run_single_model output_df = run_model(model, exam_list, parameters, turn_on_visualization) File "src/scripts/run_model.py", line 183, in run_model output = model(tensor_batch) File "/home/zhao/anaconda3/envs/pytorch/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl return forward_call(*input, **kwargs) File "/media/zhao/HD1/work_zhao/GMIC-master/src/modeling/gmic.py", line 126, in forward self.patch_locations = self._convert_crop_position(small_x_locations, self.cam_size, x_original) File "/media/zhao/HD1/work_zhao/GMIC-master/src/modeling/gmic.py", line 80, in _convert_crop_position assert np.min(top_k_prop_y) >= 0.0, "top_k_prop_y <= 0.0" AssertionError: top_k_prop_y <= 0.0

seyiqi commented 2 years ago

Hi @taijizhao ,

I am glad this repo is helpful to you. The cause is probably the torch version. This script was developed under torch 1.1.0. Please see this post for more info: https://github.com/nyukat/GMIC/issues/13

Best,

taijizhao commented 2 years ago

Hi @taijizhao ,

I am glad this repo is helpful to you. The cause is probably the torch version. This script was developed under torch 1.1.0. Please see this post for more info: #13

Best,

Thank you very much! I should have checked previous posts more carefully.