From 804ba978972a969d47ad296d3eae6b3658582677 Mon Sep 17 00:00:00 2001 From: Arnav Garg Date: Wed, 14 Sep 2022 12:35:31 -0700 Subject: [PATCH 1/3] test fix --- ludwig/features/image_feature.py | 2 +- tests/integration_tests/test_ray.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ludwig/features/image_feature.py b/ludwig/features/image_feature.py index 96a61063f29..6d8b4a7f0d5 100644 --- a/ludwig/features/image_feature.py +++ b/ludwig/features/image_feature.py @@ -175,7 +175,7 @@ def _read_image_if_bytes_obj_and_resize( if isinstance(img_entry, bytes): img = read_image_from_bytes_obj(img_entry, num_channels) elif isinstance(img_entry, np.ndarray): - img = torch.from_numpy(img_entry).permute(2, 0, 1) + img = torch.from_numpy(np.array(img_entry, copy=True)).permute(2, 0, 1) else: img = img_entry diff --git a/tests/integration_tests/test_ray.py b/tests/integration_tests/test_ray.py index 9fef08f1799..b35f0c7c70d 100644 --- a/tests/integration_tests/test_ray.py +++ b/tests/integration_tests/test_ray.py @@ -334,8 +334,8 @@ def test_ray_audio(tmpdir, dataset_type, ray_cluster_2cpu): @pytest.mark.parametrize("dataset_type", ["csv", "parquet", "pandas+numpy_images"]) @pytest.mark.distributed def test_ray_image(tmpdir, dataset_type, ray_cluster_2cpu): - if _ray_nightly and dataset_type == "pandas+numpy_images": - pytest.skip("https://github.com/ludwig-ai/ludwig/issues/2452") + # if _ray_nightly and dataset_type == "pandas+numpy_images": + # pytest.skip("https://github.com/ludwig-ai/ludwig/issues/2452") image_dest_folder = os.path.join(tmpdir, "generated_images") input_features = [ From 538b6abe0fe0e652dfb0cd22ecb7607806b218a3 Mon Sep 17 00:00:00 2001 From: Arnav Garg Date: Wed, 14 Sep 2022 13:32:54 -0700 Subject: [PATCH 2/3] Fixes tests --- tests/integration_tests/test_ray.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/tests/integration_tests/test_ray.py b/tests/integration_tests/test_ray.py index e3736e7d652..2fad952ac62 100644 --- a/tests/integration_tests/test_ray.py +++ b/tests/integration_tests/test_ray.py @@ -346,9 +346,6 @@ def test_ray_audio(tmpdir, dataset_type, ray_cluster_2cpu): @pytest.mark.parametrize("dataset_type", ["csv", "parquet", "pandas+numpy_images"]) @pytest.mark.distributed def test_ray_image(tmpdir, dataset_type, ray_cluster_2cpu): - # if _ray_nightly and dataset_type == "pandas+numpy_images": - # pytest.skip("https://github.com/ludwig-ai/ludwig/issues/2452") - image_dest_folder = os.path.join(tmpdir, "generated_images") input_features = [ image_feature( From eab59d3be2b296f560a56e1dcae5459b96b87572 Mon Sep 17 00:00:00 2001 From: Arnav Garg Date: Wed, 14 Sep 2022 13:47:01 -0700 Subject: [PATCH 3/3] Pin transformers version --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index bda549398da..135ccdd8ffb 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,7 +10,7 @@ torch>=1.10.0 torchaudio torchtext torchvision>=0.10.1 -transformers>=4.10.1 +transformers>=4.10.1,<4.22 spacy>=2.3 PyYAML>=3.12 absl-py