pytorch / pytorch/tutorials

[BUG]-Network error while importing flava_model_for_classification from torchmultimodal

Open
#2,611 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug torchmultimodal
Dominant language
Python
Stars
9.3k
Forks
4.4k
Avg merge
1d 21h
Merged PRs (30d)
4

Description

Add Link

https://pytorch.org/tutorials/beginner/flava_finetuning_tutorial.html

Describe the bug

In the following code snippet:

from torchmultimodal.models.flava.model import flava_model_for_classification
model = flava_model_for_classification(num_classes=len(vocab))

I am getting the following error:

Failed to download https://download.pytorch.org/models/multimodal/flava/flava_for_pretraining_unified_text_encoder.pt

Here is the error trace:

SSLCertVerificationError                  Traceback (most recent call last)
File [/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py:1348](https://file+.vscode-resource.vscode-cdn.net/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py:1348), in AbstractHTTPHandler.do_open(self, http_class, req, **http_conn_args)
   1347 try:
-> 1348     h.request(req.get_method(), req.selector, req.data, headers,
   1349               encode_chunked=req.has_header('Transfer-encoding'))
   1350 except OSError as err: # timeout error

File [/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/http/client.py:1286](https://file+.vscode-resource.vscode-cdn.net/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/http/client.py:1286), in HTTPConnection.request(self, method, url, body, headers, encode_chunked)
   1285 """Send a complete request to the server."""
-> 1286 self._send_request(method, url, body, headers, encode_chunked)

File [/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/http/client.py:1332](https://file+.vscode-resource.vscode-cdn.net/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/http/client.py:1332), in HTTPConnection._send_request(self, method, url, body, headers, encode_chunked)
   1331     body = _encode(body, 'body')
-> 1332 self.endheaders(body, encode_chunked=encode_chunked)

File [/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/http/client.py:1281](https://file+.vscode-resource.vscode-cdn.net/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/http/client.py:1281), in HTTPConnection.endheaders(self, message_body, encode_chunked)
   1280     raise CannotSendHeader()
-> 1281 self._send_output(message_body, encode_chunked=encode_chunked)

File [/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/http/client.py:1041](https://file+.vscode-resource.vscode-cdn.net/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/http/client.py:1041), in HTTPConnection._send_output(self, message_body, encode_chunked)
   1040 del self._buffer[:]
-> 1041 self.send(msg)
   1043 if message_body is not None:
   1044 
...
-> 1351         raise URLError(err)
   1352     r = h.getresponse()
   1353 except:

URLError:
Describe your environment

Platform: macOS
Python version: 3.11.6
CUDA: no
PyTorch version: 2.0.1

cc @kartikayk @ankitade

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the code snippet from the linked FLAVA fine-tuning tutorial in the reported macOS and Python environment, then inspect the flava_model_for_classification entry point and the failing model-download URL. Done means the tutorial no longer leads to the reported SSL download failure, or clearly documents the required resolution if the cause is external.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
documentation, machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.