def get_conv_rows_cols(height, width):
    """
    Calculates the dimensions of the last conv4 layer for a given image size.
    :param height: positive integer, the image height in pixels.
    :param width: positive integer, the image width in pixels.
    :return: height and width of the last conv4 layer as a list of integers.
    """
    dims = [height, width]
    for i in range(len(dims)):
        # (3, 3) zeropad
        dims[i] += 6
        for filter_size in [7, 3, 1, 1]:
            # all strides use valid padding, formula is (W - F + 2P) / S + 1
            dims[i] = (dims[i] - filter_size) // 2 + 1

    return dims