@pytest.mark.skipif(_IMAGE_AVAILABLE, reason='image libraries are installed.')
def test_load_from_checkpoint_dependency_error():
    with pytest.raises(ModuleNotFoundError, match=re.escape("'lightning-flash[image]'")):
        SemanticSegmentation.load_from_checkpoint('not_a_real_checkpoint.pt')
@pytest.mark.skipif(_IMAGE_AVAILABLE, reason='image libraries are installed.')
def test_load_from_checkpoint_dependency_error():
    with pytest.raises(ModuleNotFoundError, match=re.escape("'lightning-flash[image]'")):
        SemanticSegmentation.load_from_checkpoint('not_a_real_checkpoint.pt')