Grounded-Segment-Anything
Grounded-Segment-Anything copied to clipboard
About Network Connect
requests.exceptions.ConnectionError: (ProtocolError('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')), '(Request ID: ea7dea4f-6b82-401c-84a6-3d970e2416ba)')
requests.exceptions.ConnectionError: (ProtocolError('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')), '(Request ID: ea7dea4f-6b82-401c-84a6-3d970e2416ba)')
It may be that your network is not stable when connecting to Huggingface, you can also try to download the pre-trained BERT-based model from Huggingface to your local directory and set a specific path to it.
requests.exceptions.ConnectionError: (ProtocolError('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')), '(Request ID: ea7dea4f-6b82-401c-84a6-3d970e2416ba)')
It may be that your network is not stable when connecting to Huggingface, you can also try to download the pre-trained BERT-based model from Huggingface to your local directory and set a specific path to it.
Can you be more specific about the method of downloading the file, I had this problem too, it used to work, now it doesn't work.
requests.exceptions.ConnectionError: (ProtocolError('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')), '(Request ID: ea7dea4f-6b82-401c-84a6-3d970e2416ba)')
It may be that your network is not stable when connecting to Huggingface, you can also try to download the pre-trained BERT-based model from Huggingface to your local directory and set a specific path to it.
Can you be more specific about the method of downloading the file, I had this problem too, it used to work, now it doesn't work.
You can try the following steps:
- First, download the pre-trained
bert-base-uncased
checkpoint from Huggingface's official link: https://huggingface.co/bert-base-uncased/tree/main - Put it in your local directory, remember to download all the files from Huggingface
- Update the tokenizer instance here: https://github.com/IDEA-Research/GroundingDINO/blob/60d796825e1266e56f7e4e9e00e88de662b67bd3/groundingdino/util/get_tokenlizer.py#L23
BertTokenizer.from_pretrained(PATH, local_files_only=True) # PATH is your local file path
If there're some error when loading local checkpoint, you can try to check the hugging face's documentation for more details about the usage.
ef get_pretrained_language_model(text_encoder_type):
if text_encoder_type == "bert-base-uncased":
return BertTokenizer.from_pretrained('bert-base-uncased', local_files_only=True) # PATH is your local file path
# return BertModel.from_pretrained(text_encoder_type)
is that right?
ef get_pretrained_language_model(text_encoder_type): if text_encoder_type == "bert-base-uncased": return BertTokenizer.from_pretrained('bert-base-uncased', local_files_only=True) # PATH is your local file path # return BertModel.from_pretrained(text_encoder_type)
is that right?
I think it may work
You can refer to huggingface's documentation for more details
File "/home/evsjtu2/disk1/gumingxiang/GSAM/Grounded-Segment-Anything/grounded_sam_demo.py", line 181, in
It returns the question, can you help me to solve?Or the problem is hugging face?
File "/home/evsjtu2/disk1/gumingxiang/GSAM/Grounded-Segment-Anything/grounded_sam_demo.py", line 181, in model = load_model(config_file, grounded_checkpoint, device=device) File "/home/evsjtu2/disk1/gumingxiang/GSAM/Grounded-Segment-Anything/grounded_sam_demo.py", line 46, in load_model model = build_model(args) File "/home/evsjtu2/disk1/gumingxiang/GSAM/Grounded-Segment-Anything/GroundingDINO/groundingdino/models/init.py", line 17, in build_model model = build_func(args) File "/home/evsjtu2/disk1/gumingxiang/GSAM/Grounded-Segment-Anything/GroundingDINO/groundingdino/models/GroundingDINO/groundingdino.py", line 372, in build_groundingdino model = GroundingDINO( File "/home/evsjtu2/disk1/gumingxiang/GSAM/Grounded-Segment-Anything/GroundingDINO/groundingdino/models/GroundingDINO/groundingdino.py", line 109, in init self.bert.pooler.dense.weight.requires_grad_(False) AttributeError: 'BertTokenizer' object has no attribute 'pooler'
It returns the question, can you help me to solve?Or the problem is hugging face?
There're something wrong with this, you use BertTokenizer instead of BertModel, they're different
ef get_pretrained_language_model(text_encoder_type): if text_encoder_type == "bert-base-uncased": return BertTokenizer.from_pretrained('bert-base-uncased', local_files_only=True) # PATH is your local file path # return BertModel.from_pretrained(text_encoder_type)
is that right?
I think it may work
You can refer to huggingface's documentation for more details
Please use BertModel
instead of BertTokenizer
, one is the tokenizer for converting words into embeddings, the other is original BERT model
/home/evsjtu2/miniconda3/envs/gmx-sam/lib/python3.9/site-packages/torch/functional.py:478: UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at /opt/conda/conda-bld/pytorch_1659484809662/work/aten/src/ATen/native/TensorShape.cpp:2894.)
return _VF.meshgrid(tensors, **kwargs) # type: ignore[attr-defined]
final text_encoder_type: bert-base-uncased
Traceback (most recent call last):
File "/home/evsjtu2/disk1/gumingxiang/GSAM/Grounded-Segment-Anything/grounded_sam_demo.py", line 181, in
After I made the changes, I still prompted for network connectivity issues. Should there be no other areas in the model that require network connectivity besides the hooking face?
I have already solved this problem. Thank you for your help!
I have already solved this problem. Thank you for your help!
hello, same question we meet, could you share your step-by-step solution for us to solve this problem? thank you very much for your kindest action.
I have already solved this problem. Thank you for your help!
hello, same question we meet, could you share your step-by-step solution for us to solve this problem? thank you very much for your kindest action.
- First, download the pre-trained bert-base-uncased checkpoint from Huggingface's official link: https://huggingface.co/bert-base-uncased/tree/main
- Put it in your local directory, remember to download all the files from Huggingface
- Update the tokenizer instance in /Grounded-Segment-Anything/GroundingDINO/groundingdino/util/get_tokenlizer.py
# tokenizer = AutoTokenizer.from_pretrained(text_encoder_type)
tokenizer = AutoTokenizer.from_pretrained('YOUR PATH/bert-base-uncased', cache_dir='bert-base-uncased')
# return BertModel.from_pretrained(text_encoder_type)
return BertModel.from_pretrained('YOUR PATH/bert-base-uncased', local_files_only=True)
I have already solved this problem. Thank you for your help!
hello, same question we meet, could you share your step-by-step solution for us to solve this problem? thank you very much for your kindest action.
- First, download the pre-trained bert-base-uncased checkpoint from Huggingface's official link: https://huggingface.co/bert-base-uncased/tree/main
- Put it in your local directory, remember to download all the files from Huggingface
- Update the tokenizer instance in /Grounded-Segment-Anything/GroundingDINO/groundingdino/util/get_tokenlizer.py
# tokenizer = AutoTokenizer.from_pretrained(text_encoder_type) tokenizer = AutoTokenizer.from_pretrained('YOUR PATH/bert-base-uncased', cache_dir='bert-base-uncased')
# return BertModel.from_pretrained(text_encoder_type) return BertModel.from_pretrained('YOUR PATH/bert-base-uncased', local_files_only=True)
miss other error: final text_encoder_type: bert-base-uncased safetensors_rust.SafetensorError: Error while deserializing header: HeaderTooLarge
LOL. I encountered this problem today because huggingface is under maintenance : )