Repository: tensorflow
Issue: KeyError: "There is no item named 'PetImages\\Cat\\0.jpg' in the archive" When Running TensorFlow Locally(CPU) on Anaconda in VS Code.
Labels: type:others,2.17

### Issue type

Documentation Bug

### Have you reproduced the bug with TensorFlow Nightly?

No

### Source

source

### TensorFlow version

2.17.1

### Custom code

Yes

### OS platform and distribution

window11

### Mobile device

_No response_

### Python version

3.10.11

### Bazel version

_No response_

### GCC/compiler version

_No response_

### CUDA/cuDNN version

_No response_

### GPU model and memory

_No response_

### Current behavior?

I am a beginner and encountering an issue while trying to run TensorFlow locally using Anaconda in VS Code. The same code runs smoothly on Google Colab, but when executed locally, it fails during the dataset download process with the following error.

What I've Tried
Re-downloading TensorFlow and TensorFlow Datasets to ensure they are up to date.
Manually Unzipping the Dataset and verifying if 'PetImages/Cat/0.jpg' exists in the archive.
Re-adjusting Python, TensorFlow, and TensorFlow Datasets Versions to match those in Colab by using Python 3.10.11 instead of Python 3.10.12.
Recreating the Virtual Environment in Anaconda to ensure a clean setup.
Downloading the Cats vs Dogs Dataset from Different Sources, but the issue persists.
Asking ChatGPT for assistance, but the issue remains unresolved.

Additional Information
On Google Colab, the same code runs without any issues, and the dataset downloads successfully.
In VS Code, the error consistently occurs during the dataset download process, indicating that 'PetImages/Cat/0.jpg' is missing from the archive.
Network Stability: I have a stable internet connection, and downloads complete without interruption, but the error persists.

Questions
Why does the KeyError occur in VS Code but not in Google Colab?
Could this be related to the way the dataset is being downloaded or unzipped locally?
Are there any compatibility issues between the Python/TensorFlow versions and the dataset?
Request for Help
I would greatly appreciate any guidance or suggestions on how to resolve this issue. Thank you in advance for your assistance!


### Standalone code to reproduce the issue

```shell
import tensorflow_datasets as tfds
import tensorflow as tf
import numpy as np



CatsVsDogs_OrgData, info=tfds.load(name='cats_vs_dogs', with_info=True,
                  split=tfds.Split.TRAIN)
```


### Relevant log output

```shell
PS C:\Users\jbb86\桌面\圖樣辨識> & C:/Users/jbb86/桌面/圖樣辨識/.venv/Scripts/python.exe c:/Users/jbb86/桌面/圖樣辨識/.venv/CatsVsDogs.py
2025-01-03 22:38:53.599253: I tensorflow/core/util/port.cc:153] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
2025-01-03 22:38:54.247816: I tensorflow/core/util/port.cc:153] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
Downloading and preparing dataset Unknown size (download: Unknown size, generated: Unknown size, total: Unknown size) to C:\Users\jbb86\tensorflow_datasets\cats_vs_dogs\4.0.1...
Dl Size...: 100%|██████████████████████████████████████████████████████████████████████████████████████████| 824887076/824887076 [00:00<00:00, 803489819418.28 MiB/s]
Dl Completed...: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 974.06 url/s]
Generating splits...:   0%|                                   2025-01-03 22:38:55.958212: I tensorflow/core/platform/cpu_feature_guard.cc:210] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 AVX512F AVX512_VNNI FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
Traceback (most recent call last):
  File "c:\Users\jbb86\桌面\圖樣辨識\.venv\CatsVsDogs.py", line 7, in <module>
    CatsVsDogs_OrgData, info=tfds.load(name='cats_vs_dogs', with_info=True,
  File "C:\Users\jbb86\桌面\圖樣辨識\.venv\lib\site-packages\tensorflow_datasets\core\logging\__init__.py", line 176, in __call__
    return function(*args, **kwargs)
  File "C:\Users\jbb86\桌面\圖樣辨識\.venv\lib\site-packages\tensorflow_datasets\core\load.py", line 661, in load
    _download_and_prepare_builder(dbuilder, download, download_and_prepare_kwargs)
  File "C:\Users\jbb86\桌面\圖樣辨識\.venv\lib\site-packages\tensorflow_datasets\core\load.py", line 517, in _download_and_prepare_builder
    dbuilder.download_and_prepare(**download_and_prepare_kwargs)
  File "C:\Users\jbb86\桌面\圖樣辨識\.venv\lib\site-packages\tensorflow_datasets\core\logging\__init__.py", line 176, in __call__
    return function(*args, **kwargs)
  File "C:\Users\jbb86\桌面\圖樣辨識\.venv\lib\site-packages\tensorflow_datasets\core\dataset_builder.py", line 756, in download_and_prepare
    self._download_and_prepare(
  File "C:\Users\jbb86\桌面\圖樣辨識\.venv\lib\site-packages\tensorflow_datasets\core\dataset_builder.py", line 1752, in _download_and_prepare
    split_infos = self._generate_splits(dl_manager, download_config)
  File "C:\Users\jbb86\桌面\圖樣辨識\.venv\lib\site-packages\tensorflow_datasets\core\dataset_builder.py", line 1727, in _generate_splits
    future = split_builder.submit_split_generation(
  File "C:\Users\jbb86\桌面\圖樣辨識\.venv\lib\site-packages\tensorflow_datasets\core\split_builder.py", line 436, in submit_split_generation
    return self._build_from_generator(**build_kwargs)
  File "C:\Users\jbb86\桌面\圖樣辨識\.venv\lib\site-packages\tensorflow_datasets\core\split_builder.py", line 496, in _build_from_generator
    for key, example in utils.tqdm(
  File "C:\Users\jbb86\桌面\圖樣辨識\.venv\lib\site-packages\tqdm\std.py", line 1181, in __iter__
    for obj in iterable:
  File "C:\Users\jbb86\桌面\圖樣辨識\.venv\lib\site-packages\tensorflow_datasets\image_classification\cats_vs_dogs.py", line 117, in _generate_examples
    new_fobj = zipfile.ZipFile(buffer).open(fname)
  File "C:\Users\jbb86\AppData\Local\Programs\Python\Python310\lib\zipfile.py", line 1516, in open
    zinfo = self.getinfo(name)
  File "C:\Users\jbb86\AppData\Local\Programs\Python\Python310\lib\zipfile.py", line 1443, in getinfo
    raise KeyError(
KeyError: "There is no item named 'PetImages\\\\Cat\\\\0.jpg' in the archive"
```