nyukat / breast_cancer_classifier

Deep Neural Networks Improve Radiologists' Performance in Breast Cancer Screening
https://ieeexplore.ieee.org/document/8861376
GNU Affero General Public License v3.0
835 stars 265 forks source link

Batch size != 1 #15

Closed Fede112 closed 5 years ago

Fede112 commented 5 years ago

Hi,

With the last update of the repo I can no longer use --batch-size 2 to run the full model (stage 4a. in run.sh). The problem is in this assertion:

def compute_batch_predictions(y_hat, mode):
    """
    Format predictions from different heads
    """

    if mode == MODELMODES.VIEW_SPLIT:
        assert y_hat[VIEWANGLES.CC].shape == (1, 4, 2)
        assert y_hat[VIEWANGLES.MLO].shape == (1, 4, 2)

The first dimension depends on the batch-size.

Hope it is useful.

zphang commented 5 years ago

Thanks for the catch! We have pushed a commit to correct this issue: https://github.com/nyukat/breast_cancer_classifier/commit/d6cc3e153c32d624961eddc832d09d40e6450426