jamesdolezal / slideflow

Deep learning library for digital pathology, with both Tensorflow and PyTorch support.
https://slideflow.dev
GNU General Public License v3.0
234 stars 39 forks source link

Robust check for empty array in missing slides screen #332

Closed Mr-Milk closed 8 months ago

Mr-Milk commented 8 months ago

When I was playing around with slideflow on feature extraction, this line of code would always raise errors like ValueError: operands could not be broadcast together with shapes (4641,2048) (0,). This is because the left side could be either numpy array or tensor or just list (I guess). It would be good to check it in a more robust way. But I'm not sure if the modification in the PR is the best way to do it.

jamesdolezal commented 8 months ago

Thank you! This is a good fix, I've merged your suggestion onto master. It'll get included in the 2.2.1 patch release in the next few days.