Skip to content

Question about ConvertPyTorchModels.ipynb #15

Closed Pinned Answered by arindal1
simanders asked this question in Q&A
Discussion options

You must be logged in to vote

To answer it simply, the WGet version I installed wasn't working properly, so I looked for an alternative.
The purpose of WGet is just to download YOLOv5's PyTorch models from (https://github.com/ultralytics/yolov5/releases/download/v6.1) inside ../models/.
The WGet I installed wasn't working, and was throwing errors. I looked around and remembered that urllib did the same thing.
So, I imported urllib.request, which is based on Python environment. It downloads the PyTorch models into ../models/ just like WGet would have.

for url in urls:
    filename = url.split("/")[-1]  # Extract the filename from the URL
    urllib.request.urlretrieve(url, filename)
    print(f"Downloaded {filename}")
…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by simanders
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants