Issue with Dataset caching

phisanti: <p><strong>Describe the bug</strong><br>
I am training a model for image segmentation. Using a custom transform pipeline, I found that clearing the background using a ratio with a Gaussian blurred image and histogram equalisation helps model convergence. However, when I used Monai compose to do the same, I ran into the issue that the transforms of one image seemed to affect other images. This is how I write the <code>Compose</code>:</p>
<pre data-code-wrap="python"><code class="lang-python">    img_transforms = Compose(
        [
            TIFFLoader(keys=["image"]),
            TIFFLoader(
                keys=["label"], add_channel_dim=configs.trainer_params["binary_segmentation"]
            ),  # If running on 2D images, change to True
            ComposeInspect(keys=["image"], step='before clear '),
            ClearBackgroundTransform(
                keys=["image"], sigma_r=25, method="divide", convert_32=True
            ),
            ComposeInspect(keys=["image"], step='before eq '),
            HistEq(keys=["image"]),
            ComposeInspect(keys=["image"], step='after eq '),

        ]
    )
</code></pre>
<p>And these are the individual compose:</p>
<pre data-code-wrap="python"><code class="lang-python">class ComposeInspect(object):
    def __init__(self, keys=("image", "label"), step=""):
        self.keys = keys
        self.step = step

    def __call__(self, data):
        for key in self.keys:
            if isinstance(data[key], torch.Tensor):
                tensor_debugger(data[key], key + self.step)
            elif isinstance(data[key], np.ndarray):
                x = torch.from_numpy(data[key].copy().astype(np.float32))
                tensor_debugger(x, key + self.step)
            else:
                print(f"Loading key: {data[key]}")

        return data


class TIFFLoader(object):
    def __init__(self, keys=("image", "label"), add_channel_dim="auto"):
        self.keys = keys
        self.add_channel_dim = add_channel_dim

    def __call__(self, data):
        for key in self.keys:
            if isinstance(data[key], str):
                data[key] = tifffile.imread(data[key])
                # Add an extra channel dimension
                if self.add_channel_dim == "auto" and data[key].ndim == 2:
                    data[key] = np.expand_dims(data[key], axis=0)
                elif self.add_channel_dim:
                    data[key] = np.expand_dims(data[key], axis=0)
                else:
                    pass

            elif isinstance(data[key], np.ndarray):
                # The data is already an array, so no need to load it
                pass
            else:
                print(f"Loading key: {data[key]}")
                raise ValueError(
                    f"Unsupported data type for key '{key}': {type(data[key])}"
                )

        return data


class HistEq(object):

    def __init__(self, keys):
        self.keys = keys

    def __call__(self, data):
        for key in self.keys:
            img = data[key].copy()
            img=self.to8bit(img)

            if img.ndim == 2:
                equalized = cv2.equalizeHist(img)
                equalized=equalized.astype(np.float32)
                equalized= (equalized - equalized.mean())/equalized.std()
            elif img.ndim == 3:
                equalized=np.zeros_like(img).astype(np.float32)
                for ch in range(img.shape[0]):
                    equalized_ch = cv2.equalizeHist(img.astype(np.uint8))
                    equalized_ch=equalized_ch.astype(np.float32)
                    equalized_ch= (equalized_ch - equalized_ch.mean())/equalized_ch.std()
                    equalized[ch]=equalized_ch
            else:
                raise NotImplementedError(
                    "Equalisation for 3D images or batches is not implemented yet."
                )
            data[key] = equalized
        return data

    def to8bit(self, image):

        normalized_image = (image - np.min(image)) / (np.max(image) - np.min(image))        
        scaled_image = normalized_image * 255        
        uint8_image = scaled_image.astype(np.uint8)
        
        return uint8_image


class ClearBackgroundTransform(object):
    def __init__(self, keys, sigma_r=25, method="divide", convert_32=True):
        self.keys = keys
        self.sigma_r = sigma_r
        self.method = method
        self.convert_32 = convert_32

    def __call__(self, data):
        for key in self.keys:
            img = data[key].copy()

            if self.convert_32:
                img = img.astype(np.float32)

            if img.ndim == 2:
                img = self.backgroud_remove_2d(img, self.sigma_r, self.method)

            elif img.ndim == 3:
                for i in range(img.shape[0]):
                    img[i] = self.backgroud_remove_2d(img[i], self.sigma_r, self.method)

            else:
                raise NotImplementedError(
                    "Background removal for 3D images is not implemented yet."
                )

            data[key] = img
        return data

    def round_to_odd(self, number):
        return int(number) if number % 2 == 1 else int(number) + 1

    def backgroud_remove_2d(self, img, sigma_r, method):
        # Gaussian blur
        sigma_r = self.round_to_odd(self.sigma_r)
        gaussian_blur = cv2.GaussianBlur(img, (sigma_r, sigma_r), 0)

        # Background remove
        if self.method == "subtract":
            background_removed = cv2.subtract(img, gaussian_blur)
        elif self.method == "divide":
            background_removed = cv2.divide(img, gaussian_blur)
        else:
            raise ValueError("Invalid method. Choose either 'subtract' or 'divide'")

        return background_removed
</code></pre>
<p>Note that the <code>ComposeInspect</code> is there for debugging purposes. With this code, what I see is something like:</p>
<pre><code class="lang-auto">nans imagebefore clear  max: False
inf imagebefore clear  max: False
imagebefore clear  max: 4095.0
imagebefore clear  min: 973.0
imagebefore eq  shape: torch.Size([1, 2400, 2400])
nans imagebefore eq  max: False
inf imagebefore eq  max: False
imagebefore eq  max: 1.871726632118225
imagebefore eq  min: 0.46691009402275085
imageafter eq  shape: torch.Size([1, 2400, 2400])
nans imageafter eq  max: False
inf imageafter eq  max: False
imageafter eq  max: 3.4114506244659424
imageafter eq  min: -1.236985206604004
imagebefore clear  shape: torch.Size([1, 2400, 2400])
nans imagebefore clear  max: False
inf imagebefore clear  max: False
imagebefore clear  max: 3.4114506244659424
imagebefore clear  min: -1.236985206604004
imagebefore eq  shape: torch.Size([1, 2400, 2400])
nans imagebefore eq  max: False
inf imagebefore eq  max: False
imagebefore eq  max: 4184.20849609375
imagebefore eq  min: -1909.0018310546875
imageafter eq  shape: torch.Size([1, 2400, 2400])
nans imageafter eq  max: False
inf imageafter eq  max: False
imageafter eq  max: 2.551238775253296
imageafter eq  min: -0.6024657487869263
</code></pre>
<p>Which is odd, because it seems that the transformations on one image, also happen on other image and then the values seems to accumulate and get out of hand.</p>
<p><strong>To Reproduce</strong><br>
Steps to reproduce the behavior:</p>
<ol>
<li>Go to ‘…’</li>
<li>Install ‘…’</li>
<li>Run commands ‘…’</li>
</ol>
<p><strong>Expected behavior</strong><br>
I would like the transformations to be calculated everytime <em>de novo</em> or to be calculated once and not to accumulate spilling over other images.</p>
<p><strong>Environment</strong></p>
<p>Ensuring you use the relevant python executable, please paste the output of:</p>
<pre><code class="lang-auto"># packages in environment at /Users/xxx/miniconda3/envs/DeepLearning:
#
# Name                    Version                   Build  Channel
absl-py                   2.1.0                    pypi_0    pypi
annotated-types           0.6.0              pyhd8ed1ab_0    conda-forge
aom                       3.8.2                h078ce10_0    conda-forge
appnope                   0.1.4              pyhd8ed1ab_0    conda-forge
asttokens                 2.4.1              pyhd8ed1ab_0    conda-forge
astunparse                1.6.3                    pypi_0    pypi
atomai                    0.7.8                    pypi_0    pypi
aws-c-auth                0.7.17               h382b9c6_2    conda-forge
aws-c-cal                 0.6.11               hd34e5fa_0    conda-forge
aws-c-common              0.9.15               h93a5062_0    conda-forge
aws-c-compression         0.2.18               hd34e5fa_3    conda-forge
aws-c-event-stream        0.4.2                h247c08a_8    conda-forge
aws-c-http                0.8.1               hf9e830b_10    conda-forge
aws-c-io                  0.14.7               h33d81b3_6    conda-forge
aws-c-mqtt                0.10.3               h5f4abda_4    conda-forge
aws-c-s3                  0.5.7                h606a3d2_1    conda-forge
aws-c-sdkutils            0.1.15               hd34e5fa_3    conda-forge
aws-checksums             0.1.18               hd34e5fa_3    conda-forge
aws-crt-cpp               0.26.6               h13f0230_4    conda-forge
aws-sdk-cpp               1.11.267             h134aaec_6    conda-forge
blosc                     1.21.5               hc338f07_0    conda-forge
bokeh                     3.4.1              pyhd8ed1ab_0    conda-forge
brotli                    1.1.0                hb547adb_1    conda-forge
brotli-bin                1.1.0                hb547adb_1    conda-forge
brotli-python             1.1.0            py39hb198ff7_1    conda-forge
brunsli                   0.1                  h9f76cd9_0    conda-forge
bzip2                     1.0.8                h93a5062_5    conda-forge
c-ares                    1.28.1               h93a5062_0    conda-forge
c-blosc2                  2.12.0               ha57e6be_0    conda-forge
ca-certificates           2024.2.2             hf0a4a13_0    conda-forge
certifi                   2024.2.2           pyhd8ed1ab_0    conda-forge
charls                    2.4.2                h13dd4ca_0    conda-forge
charset-normalizer        3.3.2              pyhd8ed1ab_0    conda-forge
click                     8.1.7           unix_pyh707e725_0    conda-forge
click-default-group       1.2.4              pyhd8ed1ab_0    conda-forge
cloudpickle               3.0.0              pyhd8ed1ab_0    conda-forge
colorama                  0.4.6              pyhd8ed1ab_0    conda-forge
comm                      0.2.2              pyhd8ed1ab_0    conda-forge
contourpy                 1.2.1            py39h48c5dd5_0    conda-forge
cycler                    0.12.1                   pypi_0    pypi
cytoolz                   0.12.3           py39h17cfd9d_0    conda-forge
dask                      2024.4.2           pyhd8ed1ab_0    conda-forge
dask-core                 2024.4.2           pyhd8ed1ab_0    conda-forge
dask-expr                 1.0.14             pyhd8ed1ab_0    conda-forge
dav1d                     1.2.1                hb547adb_0    conda-forge
debugpy                   1.8.1            py39hf3050f2_0    conda-forge
decorator                 5.1.1              pyhd8ed1ab_0    conda-forge
distributed               2024.4.2           pyhd8ed1ab_0    conda-forge
docformatter              1.7.5              pyhd8ed1ab_0    conda-forge
dpcore                    0.9.0                    pypi_0    pypi
einops                    0.8.0                    pypi_0    pypi
exceptiongroup            1.2.0              pyhd8ed1ab_2    conda-forge
executing                 2.0.1              pyhd8ed1ab_0    conda-forge
fastremap                 1.14.1                   pypi_0    pypi
filelock                  3.14.0             pyhd8ed1ab_0    conda-forge
flatbuffers               24.3.25                  pypi_0    pypi
fonttools                 4.51.0                   pypi_0    pypi
freetype                  2.12.1               hadb7bae_2    conda-forge
fsspec                    2024.3.1           pyhca7485f_0    conda-forge
gast                      0.5.4                    pypi_0    pypi
gflags                    2.2.2             hc88da5d_1004    conda-forge
giflib                    5.2.2                h93a5062_0    conda-forge
glog                      0.7.0                hc6770e3_0    conda-forge
gmp                       6.3.0                hebf3989_1    conda-forge
gmpy2                     2.1.5            py39hd40a46f_0    conda-forge
google-pasta              0.2.0                    pypi_0    pypi
gpytorch                  1.11                     pypi_0    pypi
grpcio                    1.63.0                   pypi_0    pypi
h5py                      3.11.0                   pypi_0    pypi
icu                       73.2                 hc8870d7_0    conda-forge
idna                      3.7                pyhd8ed1ab_0    conda-forge
imagecodecs               2023.9.18        py39ha02826a_2    conda-forge
imageio                   2.34.1                   pypi_0    pypi
importlib-metadata        7.1.0              pyha770c72_0    conda-forge
importlib-resources       6.4.0                    pypi_0    pypi
importlib_metadata        7.1.0                hd8ed1ab_0    conda-forge
ipykernel                 6.29.3             pyh3cd1d5f_0    conda-forge
ipython                   8.18.1             pyh707e725_3    conda-forge
jaxtyping                 0.2.28                   pypi_0    pypi
jedi                      0.19.1             pyhd8ed1ab_0    conda-forge
jetraw-tools              0.3.6                    pypi_0    pypi
jinja2                    3.1.3              pyhd8ed1ab_0    conda-forge
joblib                    1.4.2                    pypi_0    pypi
jupyter_client            8.6.1              pyhd8ed1ab_0    conda-forge
jupyter_core              5.7.2            py39h2804cbe_0    conda-forge
jxrlib                    1.1                  h93a5062_3    conda-forge
keras                     3.3.3                    pypi_0    pypi
kiwisolver                1.4.5                    pypi_0    pypi
krb5                      1.21.2               h92f50d5_0    conda-forge
lazy-loader               0.4                      pypi_0    pypi
lcms2                     2.16                 ha0e7c42_0    conda-forge
lerc                      4.0.0                h9a09cb3_0    conda-forge
libabseil                 20240116.2      cxx17_hebf3989_0    conda-forge
libaec                    1.1.3                hebf3989_0    conda-forge
libarrow                  15.0.2           h0fcf22f_2_cpu    conda-forge
libarrow-acero            15.0.2           h3f3aa29_2_cpu    conda-forge
libarrow-dataset          15.0.2           h3f3aa29_2_cpu    conda-forge
libarrow-flight           15.0.2           h224147a_2_cpu    conda-forge
libarrow-flight-sql       15.0.2           hb630850_2_cpu    conda-forge
libarrow-gandiva          15.0.2           h5fa1bb3_2_cpu    conda-forge
libarrow-substrait        15.0.2           hd92e347_2_cpu    conda-forge
libavif16                 1.0.4                hff135a0_2    conda-forge
libblas                   3.9.0           19_osxarm64_openblas    conda-forge
libbrotlicommon           1.1.0                hb547adb_1    conda-forge
libbrotlidec              1.1.0                hb547adb_1    conda-forge
libbrotlienc              1.1.0                hb547adb_1    conda-forge
libcblas                  3.9.0           19_osxarm64_openblas    conda-forge
libclang                  18.1.1                   pypi_0    pypi
libcrc32c                 1.1.2                hbdafb3b_0    conda-forge
libcurl                   8.7.1                h2d989ff_0    conda-forge
libcxx                    16.0.6               h4653b0c_0    conda-forge
libdeflate                1.19                 hb547adb_0    conda-forge
libedit                   3.1.20191231         hc8eb9b7_2    conda-forge
libev                     4.33                 h93a5062_2    conda-forge
libevent                  2.1.12               h2757513_1    conda-forge
libffi                    3.4.2                h3422bc3_5    conda-forge
libgfortran               5.0.0           13_2_0_hd922786_3    conda-forge
libgfortran5              13.2.0               hf226fd6_3    conda-forge
libgoogle-cloud           2.22.0               hbebe991_1    conda-forge
libgoogle-cloud-storage   2.22.0               h8a76758_1    conda-forge
libgrpc                   1.62.2               h9c18a4f_0    conda-forge
libhwloc                  2.10.0          default_h52d8fe8_1000    conda-forge
libiconv                  1.17                 h0d3ecfb_2    conda-forge
libjpeg-turbo             3.0.0                hb547adb_1    conda-forge
liblapack                 3.9.0           19_osxarm64_openblas    conda-forge
libllvm14                 14.0.6               hd1a9a77_4    conda-forge
libllvm16                 16.0.6               haab561b_3    conda-forge
libnghttp2                1.58.0               ha4dd798_1    conda-forge
libopenblas               0.3.24          openmp_hd76b1f2_0    conda-forge
libparquet                15.0.2           h5304c63_2_cpu    conda-forge
libpng                    1.6.43               h091b4b1_0    conda-forge
libprotobuf               4.25.3               hbfab5d5_0    conda-forge
libre2-11                 2023.09.01           h7b2c953_2    conda-forge
libsodium                 1.0.18               h27ca646_1    conda-forge
libsqlite                 3.45.3               h091b4b1_0    conda-forge
libssh2                   1.11.0               h7a5bd25_0    conda-forge
libthrift                 0.19.0               h026a170_1    conda-forge
libtiff                   4.6.0                ha8a6c65_2    conda-forge
libutf8proc               2.8.0                h1a8c8d9_0    conda-forge
libwebp-base              1.4.0                h93a5062_0    conda-forge
libxcb                    1.15                 hf346824_0    conda-forge
libxml2                   2.12.6               h0d0cfa8_2    conda-forge
libxslt                   1.1.39               h223e5b9_0    conda-forge
libzlib                   1.2.13               h53f4e23_5    conda-forge
libzopfli                 1.0.3                h9f76cd9_0    conda-forge
linear-operator           0.5.2                    pypi_0    pypi
llvm-openmp               15.0.7               h7cfbb63_0    conda-forge
llvmlite                  0.42.0           py39h047a24b_1    conda-forge
locket                    1.0.0              pyhd8ed1ab_0    conda-forge
lxml                      5.1.1            py39h8557d04_0    conda-forge
lz4                       4.3.3            py39hf99b9d6_0    conda-forge
lz4-c                     1.9.4                hb7217d7_0    conda-forge
markdown                  3.6                      pypi_0    pypi
markdown-it-py            3.0.0                    pypi_0    pypi
markupsafe                2.1.5            py39h17cfd9d_0    conda-forge
matplotlib                3.8.4                    pypi_0    pypi
matplotlib-inline         0.1.7              pyhd8ed1ab_0    conda-forge
mdurl                     0.1.2                    pypi_0    pypi
mendeleev                 0.6.1                    pypi_0    pypi
ml-dtypes                 0.3.2                    pypi_0    pypi
monai                     1.3.0                    pypi_0    pypi
mpc                       1.3.1                h91ba8db_0    conda-forge
mpfr                      4.2.1                h41d338b_1    conda-forge
mpmath                    1.3.0              pyhd8ed1ab_0    conda-forge
msgpack-python            1.0.7            py39he9de807_0    conda-forge
namex                     0.0.8                    pypi_0    pypi
ncurses                   6.4.20240210         h078ce10_0    conda-forge
nd2                       0.10.1             pyhd8ed1ab_0    conda-forge
nest-asyncio              1.6.0              pyhd8ed1ab_0    conda-forge
networkx                  3.2.1              pyhd8ed1ab_0    conda-forge
numba                     0.59.1           py39h313beb8_0  
numpy                     1.26.4           py39h7aa2656_0    conda-forge
ome-types                 0.5.1.post1        pyhd8ed1ab_0    conda-forge
opencv-python             4.9.0.80                 pypi_0    pypi
openjpeg                  2.5.2                h9f1df11_0    conda-forge
openssl                   3.3.0                h0d3ecfb_0    conda-forge
opt-einsum                3.3.0                    pypi_0    pypi
optree                    0.11.0                   pypi_0    pypi
orc                       2.0.0                h3d3088e_0    conda-forge
packaging                 24.0               pyhd8ed1ab_0    conda-forge
pandas                    2.2.2            py39h47e51b9_0    conda-forge
parso                     0.8.4              pyhd8ed1ab_0    conda-forge
partd                     1.4.1              pyhd8ed1ab_0    conda-forge
pexpect                   4.9.0              pyhd8ed1ab_0    conda-forge
pickleshare               0.7.5                   py_1003    conda-forge
pillow                    10.3.0           py39h3352c98_0    conda-forge
pint                      0.23               pyhd8ed1ab_0    conda-forge
pip                       24.0               pyhd8ed1ab_0    conda-forge
platformdirs              4.2.1              pyhd8ed1ab_0    conda-forge
progressbar2              4.4.2                    pypi_0    pypi
prompt-toolkit            3.0.42             pyha770c72_0    conda-forge
protobuf                  4.25.3                   pypi_0    pypi
psutil                    5.9.8            py39h17cfd9d_0    conda-forge
pthread-stubs             0.4               h27ca646_1001    conda-forge
ptyprocess                0.7.0              pyhd3deb0d_0    conda-forge
pure_eval                 0.2.2              pyhd8ed1ab_0    conda-forge
pyarrow                   15.0.2          py39hcacd782_2_cpu    conda-forge
pyarrow-hotfix            0.6                pyhd8ed1ab_0    conda-forge
pydantic                  2.7.1              pyhd8ed1ab_0    conda-forge
pydantic-compat           0.1.2              pyhd8ed1ab_0    conda-forge
pydantic-core             2.18.2           py39h8081647_0    conda-forge
pyfiglet                  1.0.2                    pypi_0    pypi
pygments                  2.17.2             pyhd8ed1ab_0    conda-forge
pyparsing                 3.1.2                    pypi_0    pypi
pysocks                   1.7.1              pyha2e5f31_6    conda-forge
python                    3.9.19          hd7ebdb9_0_cpython    conda-forge
python-dateutil           2.9.0              pyhd8ed1ab_0    conda-forge
python-tzdata             2024.1             pyhd8ed1ab_0    conda-forge
python-utils              3.8.2                    pypi_0    pypi
python_abi                3.9                      4_cp39    conda-forge
pytorch                   2.4.0.dev20240506         py3.9_0    pytorch-nightly
pytz                      2024.1             pyhd8ed1ab_0    conda-forge
pyyaml                    6.0.1            py39h0f82c59_1    conda-forge
pyzmq                     26.0.2           py39hf4e74ac_0    conda-forge
rav1e                     0.6.6                h69fbcac_2    conda-forge
re2                       2023.09.01           h4cba328_2    conda-forge
readline                  8.2                  h92ec313_1    conda-forge
requests                  2.31.0             pyhd8ed1ab_0    conda-forge
resource_backed_dask_array 0.1.0              pyhd8ed1ab_1    conda-forge
rich                      13.7.1                   pypi_0    pypi
ruff                      0.4.2            py39h0a9ff32_0    conda-forge
scikit-image              0.22.0                   pypi_0    pypi
scikit-learn              1.4.2                    pypi_0    pypi
scipy                     1.13.0                   pypi_0    pypi
seaborn                   0.13.2                   pypi_0    pypi
setuptools                69.5.1             pyhd8ed1ab_0    conda-forge
six                       1.16.0             pyh6c4a22f_0    conda-forge
snappy                    1.1.10               hd04f947_1    conda-forge
sortedcontainers          2.4.0              pyhd8ed1ab_0    conda-forge
sqlalchemy                2.0.29                   pypi_0    pypi
stack_data                0.6.2              pyhd8ed1ab_0    conda-forge
svt-av1                   2.0.0                h078ce10_0    conda-forge
sympy                     1.12            pypyh9d50eac_103    conda-forge
tbb                       2021.12.0            h420ef59_1    conda-forge
tblib                     3.0.0              pyhd8ed1ab_0    conda-forge
tensorboard               2.16.2                   pypi_0    pypi
tensorboard-data-server   0.7.2                    pypi_0    pypi
tensorflow                2.16.1                   pypi_0    pypi
tensorflow-io-gcs-filesystem 0.37.0                   pypi_0    pypi
termcolor                 2.4.0                    pypi_0    pypi
threadpoolctl             3.5.0                    pypi_0    pypi
tifffile                  2024.4.24          pyhd8ed1ab_0    conda-forge
tk                        8.6.13               h5083fa2_1    conda-forge
toolz                     0.12.1             pyhd8ed1ab_0    conda-forge
toposort                  1.10               pyhd8ed1ab_0    conda-forge
torchvision               0.19.0.dev20240506        py39_cpu    pytorch-nightly
tornado                   6.4              py39h17cfd9d_0    conda-forge
tqdm                      4.66.4             pyhd8ed1ab_0    conda-forge
traitlets                 5.14.3             pyhd8ed1ab_0    conda-forge
typeguard                 2.13.3                   pypi_0    pypi
typing-extensions         4.11.0               hd8ed1ab_0    conda-forge
typing_extensions         4.11.0             pyha770c72_0    conda-forge
tzdata                    2024a                h0c530f3_0    conda-forge
untokenize                0.1.1                      py_0    conda-forge
urllib3                   2.2.1              pyhd8ed1ab_0    conda-forge
wcwidth                   0.2.13             pyhd8ed1ab_0    conda-forge
werkzeug                  3.0.2                    pypi_0    pypi
wheel                     0.43.0             pyhd8ed1ab_1    conda-forge
wrapt                     1.16.0                   pypi_0    pypi
xorg-libxau               1.0.11               hb547adb_0    conda-forge
xorg-libxdmcp             1.1.3                h27ca646_0    conda-forge
xsdata                    24.3.1             pyhd8ed1ab_0    conda-forge
xyzservices               2024.4.0           pyhd8ed1ab_0    conda-forge
xz                        5.2.6                h57fd34a_0    conda-forge
yaml                      0.2.5                h3422bc3_2    conda-forge
zeromq                    4.3.5                h5119023_3    conda-forge
zfp                       1.0.0                h82938aa_4    conda-forge
zict                      3.0.0              pyhd8ed1ab_0    conda-forge
zipp                      3.17.0             pyhd8ed1ab_0    conda-forge
zlib-ng                   2.0.7                h1a8c8d9_0    conda-forge
zstd                      1.5.6                hb46c0d2_0    conda-forge
</code></pre>
<pre><code class="lang-auto">python -c "import monai; monai.config.print_debug_info()"

================================
Printing MONAI config...
================================
MONAI version: 1.3.0
Numpy version: 1.26.4
Pytorch version: 2.4.0.dev20240506
MONAI flags: HAS_EXT = False, USE_COMPILED = False, USE_META_DICT = False
MONAI rev id: 865972f7a791bf7b42efbcd87c8402bd865b329e
MONAI __file__: /Users/&lt;username&gt;/miniconda3/envs/DeepLearning/lib/python3.9/site-packages/monai/__init__.py

Optional dependencies:
Pytorch Ignite version: NOT INSTALLED or UNKNOWN VERSION.
ITK version: NOT INSTALLED or UNKNOWN VERSION.
Nibabel version: NOT INSTALLED or UNKNOWN VERSION.
scikit-image version: 0.22.0
scipy version: 1.13.0
Pillow version: 10.3.0
Tensorboard version: 2.16.2
gdown version: NOT INSTALLED or UNKNOWN VERSION.
TorchVision version: 0.19.0.dev20240506
tqdm version: 4.66.4
lmdb version: NOT INSTALLED or UNKNOWN VERSION.
psutil version: 5.9.8
pandas version: 2.2.2
einops version: 0.8.0
transformers version: NOT INSTALLED or UNKNOWN VERSION.
mlflow version: NOT INSTALLED or UNKNOWN VERSION.
pynrrd version: NOT INSTALLED or UNKNOWN VERSION.
clearml version: NOT INSTALLED or UNKNOWN VERSION.

For details about installing the optional dependencies, please visit:
    https://docs.monai.io/en/latest/installation.html#installing-the-recommended-dependencies


================================
Printing system config...
================================
System: Darwin
Mac version: 14.4.1
Platform: macOS-14.4.1-arm64-arm-64bit
Processor: arm
Machine: arm64
Python version: 3.9.19
Process name: python3.9
Command: ['python', '-c', 'import monai; monai.config.print_debug_info()']
Open files: []
Num physical CPUs: 8
Num logical CPUs: 8
Num usable CPUs: UNKNOWN for given OS
CPU usage (%): [32.5, 30.6, 26.7, 23.5, 42.0, 36.3, 8.6, 7.4]
CPU freq. (MHz): 3504
Load avg. in last 1, 5, 15 mins (%): [50.1, 53.7, 52.9]
Disk usage (%): 77.7
Avg. sensor temp. (Celsius): UNKNOWN for given OS
Total physical memory (GB): 24.0
Available memory (GB): 13.7
Used memory (GB): 8.8

================================
Printing GPU config...
================================
Num GPUs: 0
Has CUDA: False
cuDNN enabled: False
NVIDIA_TF32_OVERRIDE: None
TORCH_ALLOW_TF32_CUBLAS_OVERRIDE: None
</code></pre>
<p><strong>Additional context</strong><br>
Not required</p>
<p>Any help will be more than welcome.</p>
<p>This post was also submitted to <a href="https://github.com/Project-MONAI/MONAI/issues/7789" rel="noopener nofollow ugc">Issue with Dataset caching · Issue #7789 · Project-MONAI/MONAI (github.com)</a></p>