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
Model Summary: 213 layers, 7225885 parameters, 0 gradients
WARNING: Environment does not support cv2.imshow() or PIL Image.show() image displays
cv2.imshow() is disabled in Docker environments
Traceback (most recent call last):
File "detect.py", line 243, in <module>
main(opt)
File "detect.py", line 238, in main
run(**vars(opt))
File "/opt/conda/lib/python3.8/site-packages/torch/autograd/grad_mode.py", line 28, in decorate_context
return func(*args, **kwargs)
File "detect.py", line 92, in run
dataset = LoadStreams(source, img_size=imgsz, stride=stride, auto=pt)
File "/work/Pictures/YOLOv5/new_yolov5_1019/yolov5/123/yolov5/utils/datasets.py", line 306, in __init__
s = pafy.new(s).getbest(preftype="mp4").url # YouTube URL
File "/opt/conda/lib/python3.8/site-packages/pafy/pafy.py", line 124, in new
return Pafy(url, basic, gdata, size, callback, ydl_opts=ydl_opts)
File "/opt/conda/lib/python3.8/site-packages/pafy/backend_youtube_dl.py", line 31, in __init__
super(YtdlPafy, self).__init__(*args, **kwargs)
File "/opt/conda/lib/python3.8/site-packages/pafy/backend_shared.py", line 97, in __init__
self._fetch_basic()
File "/opt/conda/lib/python3.8/site-packages/pafy/backend_youtube_dl.py", line 54, in _fetch_basic
self._dislikes = self._ydl_info['dislike_count']
KeyError: 'dislike_count'
@alicera - got the same error but solved it using-
!pip uninstall -y pafy
!pip install git+https://github.com/Cupcakus/pafy
then run the detection onthe youtube link -works!
Reacted by AX, moongucci, Vũ Tuấn Anh, Eduardo Rosostolato, Mike, Anshul Parmar and Fariz Fadian
@alicera - got the same error but solved it using- !pip uninstall -y pafy !pip install git+https://github.com/Cupcakus/pafy then run the detection onthe youtube link -works!
Activity
glenn-jocher commentedon Dec 3, 2021
@alicera thanks for the bug report. Yes I am able to reproduce the same error. Likely related to changes at YouTube unlike policy.
Please raise this issue directly at https://github.com/mps-youtube/pafy and https://github.com/ytdl-org/youtube-dl which are the packages responsible for downloading and parsing YouTube videos and metadata.
mbgpriyanka commentedon Dec 5, 2021
@alicera - got the same error but solved it using-
!pip uninstall -y pafy
!pip install git+https://github.com/Cupcakus/pafy
then run the detection onthe youtube link -works!
alicera commentedon Dec 6, 2021
Solved it. Thanks for your help.
glenn-jocher commentedon Dec 13, 2021
@alicera @hdnh2006 see mps-youtube/pafy#305
glenn-jocher commentedon Feb 11, 2022
@hdnh2006 you're saying instead of:
run this?
EDIT: seems to also work. Pinning the pip package is probably preferable to the git install, I'll submit a PR
YouTube dependency fix `youtube_dl==2020.12.2`
YouTube dependency fix `youtube_dl==2020.12.2` (#6612)
Update Neuralmagic-YoloV5 integration to v6.1 (#29)
YouTube dependency fix `youtube_dl==2020.12.2` (ultralytics#6612)
asparmar14 commentedon Sep 15, 2022
Thanks this help
YouTube dependency fix `youtube_dl==2020.12.2` (#6612)
YouTube dependency fix `youtube_dl==2020.12.2` (#6612)