salesforce / LAVIS

LAVIS - A One-stop Library for Language-Vision Intelligence
BSD 3-Clause "New" or "Revised" License
9.81k stars 964 forks source link

urllib.error.HTTPError: HTTP Error 403: Forbidden #9

Closed behroozazarkhalili closed 2 years ago

behroozazarkhalili commented 2 years ago

Hi everyone, @dxli94 When I am running the below code, I receive the corresponding error:

import torch
from lavis.models import load_model_and_preprocess
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
# loads BLIP caption base model, with finetuned checkpoints on MSCOCO captioning dataset.
# this also loads the associated image processors
model, vis_processors, _ = load_model_and_preprocess(name="blip_caption", model_type="base_coco", is_eval=True, device=device)

The error is about loading the model from a path, which seems unreachable due to some unknown issue.

 raise HTTPError(req.full_url, code, msg, hdrs, fp)
          │         │   │         │     │    │     └ <http.client.HTTPResponse object at 0x7fa4f4114820>
          │         │   │         │     │    └ <http.client.HTTPMessage object at 0x7fa4f41149a0>
          │         │   │         │     └ 'Forbidden'
          │         │   │         └ 403
          │         │   └ <property object at 0x7fa58770f1d0>
          │         └ <urllib.request.Request object at 0x7fa4f413d790>
          └ <class 'urllib.error.HTTPError'>

Which is related to the following file. https://storage.googleapis.com/sfr-vision-language-research/LAVIS/models/BLIP/blip_coco_caption_base.pth

Could you please kindly make the models available somewhere else that can easily be accessible?

dxli94 commented 2 years ago

Hi @behroozazarkhalili, thanks for your interest.

Our model weights are hosted on Google Cloud Storage, made available for public access.

I've checked two things:

Let us know. Thanks.

behroozazarkhalili commented 2 years ago

Hi @dxli94

  1. It is unavailable for me, and I received the same error.
    <Error>
    <Code>AccessDenied</Code>
    <Message>Access denied.</Message>
    </Error>

    I have already tried it many times.

  2. As I explained, Google Cloud Storage cannot be accessible to everyone indeed.

Is it possible to put the files somewhere else in the cloud?

dxli94 commented 2 years ago

Hi @behroozazarkhalili,

It is possible to make files hosted on Google Cloud Storage publicly available. We've been doing this without issues in the past and we follow the same practice for LAVIS.

I've just tried on a machine connected to public network and can download the weight.

I can't see how this happens as for now. Is it possible due to firewall setups in your local network?

Also, is it just for this checkpoint or for all others as well?

Thanks.

behroozazarkhalili commented 2 years ago

Hi @behroozazarkhalili,

It is possible to make files hosted on Google Cloud Storage publicly available. We've been doing this without issues in the past and we follow the same practice for LAVIS.

I've just tried on a machine connected to public network and can download the weight.

I can't see how this happens as for now. Is it possible due to firewall setups in your local network?

Also, is it just for this checkpoint or for all others as well?

Thanks.

I tried with three different networks and received the same error. I have the issue for all the models I have tried so far.

BTW, it would be great if you could provide alternative addresses alongside the primary address.

Thanks.

dxli94 commented 2 years ago

I'll look into this issue and get back.

dxli94 commented 2 years ago

Hi, @behroozazarkhalili,

Can you help to confirm you can access this checkpoint, which was used in our BLIP repository and downloaded by the public users many times without issues.

Thanks.

behroozazarkhalili commented 2 years ago

Hi, @behroozazarkhalili,

Can you help to confirm you can access this checkpoint, which was used in our BLIP repository and downloaded by the public users many times without issues.

Thanks.

Hi @dxli94 Unfortunately, I couldn't access to the checkpoint.

dxli94 commented 2 years ago

Closed. Confirmed it is due to local firewall setup issue.