You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Short description
when I try to use the UCF101 dataset ,the program report something like this
tensorflow.python.framework.errors_impl.OutOfRangeError: E:\tfdsdata\datasets\ucf\downloads\thumos14_files_UCF101_videosxm55JXkGdBSDxwckqpN5c7GNr_LXm9dTyoJdpxR_aas.zip; Unknown error
#something.zip refers to any zipFile
import tensorflow.compat.v2 as tf
with tf.io.gfile.GFile('E:\\tfdsdata\\datasets\\ucf\\downloads\\something.zip', 'r') as f_obj:
z = zipfile.ZipFile(f_obj)
Link to logs
Expected behavior
I looked into the extractor.py file and fond the reason:
It seems that when zipfile.ZipFile() trys to unzip a file which is wrapped by tf.io.gfile.GFile, it throws an exception.
@contextlib.contextmanager
def _open_or_pass(path_or_fobj):
if isinstance(path_or_fobj, six.string_types):
with tf.io.gfile.GFile(path_or_fobj, 'rb') as f_obj:
yield f_obj
else:
yield path_or_fobj
I manage to solve this problem by trying to not use the wrapped file. something like this:
...
def iter_zip(arch_f):
"""Iterate over zip archive."""
with _open_or_pass(arch_f) as fobj:
########
z = zipfile.ZipFile(fobj)#change this
########
for member in z.infolist():
extract_file = z.open(member)
if member.is_dir(): # Filter directories # pytype: disable=attribute-error
continue
path = _normpath(member.filename)
if not path:
continue
yield [path, extract_file]
def iter_zip(arch_f):
"""Iterate over zip archive."""
with _open_or_pass(arch_f) as fobj:
########
z = zipfile.ZipFile(arch_f)
########
for member in z.infolist():
extract_file = z.open(member)
if member.is_dir(): # Filter directories # pytype: disable=attribute-error
continue
path = _normpath(member.filename)
if not path:
continue
yield [path, extract_file]
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
Short description
when I try to use the UCF101 dataset ,the program report something like this
tensorflow.python.framework.errors_impl.OutOfRangeError: E:\tfdsdata\datasets\ucf\downloads\thumos14_files_UCF101_videosxm55JXkGdBSDxwckqpN5c7GNr_LXm9dTyoJdpxR_aas.zip; Unknown error
Environment information
Operating System: Win10
Python version: 3.7(Conda)
tensorflow-datasets
/tfds-nightly
version: tensorflow-datasets 3.2.1tensorflow
/tf-nightly
version: tensorflow-gpu 2.3.1Does the issue still exists with the last
tfds-nightly
package (pip install --upgrade tfds-nightly
) ?yes
Reproduction instructions
mnist_train = tfds.load(name="ucf101", data_dir="E:\\tfdsdata\\datasets\\ucf")
or just reproduce the problem like this:
Link to logs
Expected behavior
I looked into the extractor.py file and fond the reason:
It seems that when zipfile.ZipFile() trys to unzip a file which is wrapped by tf.io.gfile.GFile, it throws an exception.
I manage to solve this problem by trying to not use the wrapped file. something like this:
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: