mahmoodlab / CLAM

Data-efficient and weakly supervised computational pathology on whole slide images - Nature Biomedical Engineering
http://clam.mahmoodlab.org
GNU General Public License v3.0
1.02k stars 340 forks source link

fix:score2percentile() #194

Open ljhOfGithub opened 1 year ago

GeorgeBatch commented 6 months ago

This fixed a broadcasting error for me:

Traceback (most recent call last):
  File "CLAM/create_heatmaps.py", line 371, in <module>
    compute_from_patches(wsi_object=wsi_object, clam_pred=Y_hats[0], model=model, feature_extractor=feature_extractor, batch_size=exp_args.batch_size, **wsi_kwargs, 
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "CLAM/vis_utils/heatmap_utils.py", line 77, in compute_from_patches
    A[score_idx] = score2percentile(A[score_idx], ref_scores)
    ~^^^^^^^^^^^
ValueError: could not broadcast input array from shape (195,) into shape (1,)
kaczmarj commented 1 month ago

possibly fixes https://github.com/mahmoodlab/CLAM/issues/153