microsoft / GLIP

Grounded Language-Image Pre-training
MIT License
2.23k stars 194 forks source link

question about the predict_demo #128

Open william1111111111 opened 1 year ago

william1111111111 commented 1 year ago

dear author, i do have some quetions about your demo. Something go wrong during reference. Here is the LOG: [nltk_data] Error loading punkt: <urlopen error [Errno 111] Connection [nltk_data] refused> [nltk_data] Error loading averaged_perceptron_tagger: <urlopen error [nltk_data] [Errno 111] Connection refused> False VISION BACKBONE USE GRADIENT CHECKPOINTING: False LANGUAGE BACKBONE USE GRADIENT CHECKPOINTING: False Traceback (most recent call last): File "/home/zwy/D/zsy/LLM/GLIP-main/demo.py", line 43, in glip_demo = GLIPDemo( File "/home/zwy/D/zsy/LLM/GLIP-main/maskrcnn_benchmark/engine/predictor_glip.py", line 38, in init self.model = build_detection_model(cfg) File "/home/zwy/D/zsy/LLM/GLIP-main/maskrcnn_benchmark/modeling/detector/init.py", line 11, in build_detection_model return meta_arch(cfg) File "/home/zwy/D/zsy/LLM/GLIP-main/maskrcnn_benchmark/modeling/detector/generalized_vl_rcnn.py", line 96, in init self.language_backbone = build_language_backbone(cfg) File "/home/zwy/D/zsy/LLM/GLIP-main/maskrcnn_benchmark/modeling/language_backbone/backbone.py", line 45, in build_backbone return registry.LANGUAGE_BACKBONEScfg.MODEL.LANGUAGE_BACKBONE.MODEL_TYPE File "/home/zwy/D/zsy/LLM/GLIP-main/maskrcnn_benchmark/modeling/language_backbone/backbone.py", line 14, in build_bert_backbone body = bert_model.BertEncoder(cfg) File "/home/zwy/D/zsy/LLM/GLIP-main/maskrcnn_benchmark/modeling/language_backbone/bert_model.py", line 20, in init self.model = BertModel.from_pretrained(self.bert_name, add_pooling_layer=False, config=config) File "/home/zwy/miniconda3/envs/glip/lib/python3.8/site-packages/transformers/modeling_utils.py", line 2805, in from_pretrained state_dict = load_state_dict(resolved_archive_file) File "/home/zwy/miniconda3/envs/glip/lib/python3.8/site-packages/transformers/modeling_utils.py", line 469, in load_state_dict return safe_load_file(checkpoint_file) File "/home/zwy/miniconda3/envs/glip/lib/python3.8/site-packages/safetensors/torch.py", line 310, in load_file result[k] = f.get_tensor(k) AttributeError: module 'torch' has no attribute 'frombuffer' My env : torch 1.9.0+cu102 . I have already finished python ... setup.py ..... Can you answer my question? Thx you so much!

willxxy commented 1 year ago

Is there any update on this?

CDchenlin commented 1 year ago

Same problem, it solved as I reinstall pytorch.