Subsync erroring out with "max() arg is an empty sequence".
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 7.9k
- Forks
- 323
- PR merge metrics
- No merged PRs in 30d
Description
Environment (please complete the following information):
- OS: Ubuntu 18.04 LTS
- python version: Python 2.7.17
- subsync version: subsync 0.3.4
Describe the bug
The sync process fails with an error ValueError: max() arg is an empty sequence
To Reproduce
subsync "vid.mp4" -i sub1.srt -o sub2.srt
Expected behavior
The process should succeed.
Output
INFO:subsync.subsync:extracting speech segments from reference 'vid.mp4'...
INFO:subsync.speech_transformers:Checking video for subtitles stream...
INFO:subsync.speech_transformers:Video file appears to lack subtitle stream
100%|█████████▉| 7687.72266667/7687.723 [01:33<00:00, 81.91it/s]
INFO:subsync.subsync:...done
INFO:subsync.subsync:extracting speech segments from subtitles 'sub1.srt'...
INFO:subsync.subtitle_parser:detected encoding: UTF-8
INFO:subsync.subsync:...done
INFO:subsync.subsync:computing alignments...
Traceback (most recent call last):
File "/home/user/.local/bin/subsync", line 11, in <module>
load_entry_point('subsync==0.3.4', 'console_scripts', 'subsync')()
File "/home/user/.local/lib/python2.7/site-packages/subsync/subsync.py", line 207, in main
return run(args)
File "/home/user/.local/lib/python2.7/site-packages/subsync/subsync.py", line 106, in run
srt_pipes,
File "/home/user/.local/lib/python2.7/site-packages/sklearn/base.py", line 467, in fit_transform
return self.fit(X, y, **fit_params).transform(X)
File "/home/user/.local/lib/python2.7/site-packages/subsync/aligners.py", line 77, in transform
(score, offset), subpipe = max(scores)
ValueError: max() arg is an empty sequence
Test case
vid.zip
Additional context
--
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The failure is raised in subsync/aligners.py at line 77 during the sklearn fit_transform path; start there and reproduce with the command and attached vid.zip. Confirm the same input no longer aborts during computing alignments and that the expected output subtitle file is produced.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, scikit-learn
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100