Closed VolodymyrChapman closed 9 months ago
Use this instead.
scores = self.score_model(x=features, mask=mask)
The processed data released by Owkin are arrays with shape (n_tiles, 771)
. The first 3 columns of each features array are metadata (i.e. zoom level, 1st coordinate of tile address, 2nd coordinate of tile address). If your data does not have these 3 additional columns, then the slicing is not needed. In fact, it should be optional 🐛
Thanks for the quick response :-) Ahhh, that makes sense. Making slicing an optional argument within the Chowder class sounds like the best way to maintain essential behaviour for Owkin and ease of use, if using ibot_vit as a feature extractor :-) Please let me know if you would be open to a pull request - can do on Monday. Best wishes, V
Yes, please. PRs are very welcome
Great - PR submitted :-)
FYI for future users: Addressed in PR: https://github.com/owkin/HistoSSLscaling/pull/19
Resolved in #19.
Issue description:
Slicing of scores tensor on line 168 of chowder.py leads to shape mismatch and failing forward propagation. Reason for the slicing is not clear. https://github.com/owkin/HistoSSLscaling/blob/e66c7ca4392449f56b54645acc1a0dc0f42a868b/rl_benchmarks/models/slide_models/chowder.py#L168 Example error with input of Phikon output (1,50, 768) (batch, patches, phikon features):
Suggested solution:
Changing line 168 to the below resolves the issue:
scores = self.score_model(x=features, mask=mask)
Output when running the above example with modified line 168:
tensor([[-0.0729, -0.0908, -0.0894]], grad_fn=<SqueezeBackward1>)