Closed dawalisi closed 5 months ago
I also meet some errors when I run CUDA_VISIBLE_DEVICES=0,1 python create_heatmaps.py --config config_template.yaml
.
It says:
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,)
I haven't made any changes to the code and config.
@invisprints I had the same issue, and fixed it by changing this one line in heatmap_utils.py: line 23
def score2percentile(score, ref): percentile = percentileofscore(ref.squeeze(), score.squeeze()) return percentile
@invisprints I had the same issue, and fixed it by changing this one line in heatmap_utils.py: line 23
def score2percentile(score, ref): percentile = percentileofscore(ref.squeeze(), score.squeeze()) return percentile
Hello and thank you for your advice! After I changed the code as you suggested, it appears to take up a lot of existing memory when running create_heatmaps! May I ask if you are in the same situation?
Hi, it appears you are trying to create the heatmap at a very high resolution. You can change vis_level in the config file to be larger (i.e. lower resolution).
Here the coords are lists and this statement can only read individual coords