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/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 diff --git a/tests/integration_tests/test_ray.py b/tests/integration_tests/test_ray.py index 5ca42dca93b..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(