-
Notifications
You must be signed in to change notification settings - Fork 356
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
av.read() exit gracefully on corrupt files? #485
Comments
Could you clarify what "crash" and "breaks the code" means? Does the Python interpreter exit? Or... does Python continue on as if there is no error? |
There are two scenarios:
|
Interesting. It looks like the |
@mikeboers the constructor raises this error because If one could make the constructor of |
I'm not sure I understand how PyTorch factors into this: is PyAV incorrectly constructing the AVError or is PyTorch? Settings PyTorch aside, could we have a sample file which fails without properly raising an AVError? |
The problem is in PyTorch: it captures the exception message, and raises it afterwards, but only passing a single argument. I don't believe this is really a problem with PyAV, but more a limitation on how PyTorch assumes that exceptions should have their error message as the first argument |
Note that my last link above does not correspond to the right place anymore, here is the correct line now https://github.com/pytorch/pytorch/blob/863818e05a80b970e58a9dbce09c114ecbc6879e/torch/utils/data/dataloader.py#L608 |
I'm sorry if I'm a bit slow here, but I don't understand the relation between PyTorch and PyAV : where is the code that uses DataLoader with PyAV? |
I'm not following either, and it has been a long time. Re-open if you can show us what to change with our exceptions. |
I'm trying to load some videos using
av.read
and I am aware that dataset contains corrupt files. Most corrupt files can get filtered out by a simple trycatch ashowever, on a several, the file crashes with
which is not caught in the exception, but rather completely breaks the code.
Is there a nicer way to gracefully exit or skip files upon this error?
I could do a binary search to find the videos in question but the dataset is quite large (2M examples) and it would take hours do do it by hand.
NOTE: trying to catch it with
fails as well.
The text was updated successfully, but these errors were encountered: