Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_pickle.UnpicklingError: invalid load key, 'v'. #50

Open
celster opened this issue Jul 19, 2023 · 1 comment
Open

_pickle.UnpicklingError: invalid load key, 'v'. #50

celster opened this issue Jul 19, 2023 · 1 comment

Comments

@celster
Copy link

celster commented Jul 19, 2023

I get the following error:

(igpt) host:~/fa/InternGPT$ python -u app.py --load "ImageOCRRecognition_cuda:0,Text2Image_cuda:0,SegmentAnything_cuda:0,ActionRecognition_cuda:0,VideoCaption_cuda:0,DenseCaption_cuda:0,ReplaceMaskedAnything_cuda:0,LDMInpainting_cuda:0,SegText2Image_cuda:0,ScribbleText2Image_cuda:0,Image2Scribble_cuda:0,Image2Canny_cuda:0,CannyText2Image_cuda:0,StyleGAN_cuda:0,Anything2Image_cuda:0,HuskyVQA_cuda:0" -e -p 3456 --https
[07/19 11:24:32] bark.generation WARNING: torch version does not support flash attention. You will get faster inference speed by upgrade torch to newest nightly version.
Initializing InternGPT, load_dict={'ImageOCRRecognition': 'cuda:0', 'Text2Image': 'cuda:0', 'SegmentAnything': 'cuda:0', 'ActionRecognition': 'cuda:0', 'VideoCaption': 'cuda:0', 'DenseCaption': 'cuda:0', 'ReplaceMaskedAnything': 'cuda:0', 'LDMInpainting': 'cuda:0', 'SegText2Image': 'cuda:0', 'ScribbleText2Image': 'cuda:0', 'Image2Scribble': 'cuda:0', 'Image2Canny': 'cuda:0', 'CannyText2Image': 'cuda:0', 'StyleGAN': 'cuda:0', 'Anything2Image': 'cuda:0', 'HuskyVQA': 'cuda:0'}
Initializing ImageOCRRecognition to cuda:0
Initializing Text2Image to cuda:0
text_config_dict is provided which will be used to initialize CLIPTextConfig. The value text_config["id2label"] will be overriden.
Initializing SegmentAnything to cuda:0
Traceback (most recent call last):
File "app.py", line 225, in
bot = ConversationBot(load_dict=load_dict, e_mode=args.e_mode)
File "/home/ubuntu/fa/InternGPT/iGPT/controllers/ConversationBot.py", line 144, in init
self.models[class_name] = globals()class_name
File "/home/ubuntu/fa/InternGPT/iGPT/models/image.py", line 672, in init
self.sam = sam_model_registrymodel_type
File "/home/ubuntu/anaconda3/envs/igpt/lib/python3.8/site-packages/segment_anything/build_sam.py", line 15, in build_sam_vit_h
return _build_sam(
File "/home/ubuntu/anaconda3/envs/igpt/lib/python3.8/site-packages/segment_anything/build_sam.py", line 105, in _build_sam
state_dict = torch.load(f)
File "/home/ubuntu/anaconda3/envs/igpt/lib/python3.8/site-packages/torch/serialization.py", line 795, in load
return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
File "/home/ubuntu/anaconda3/envs/igpt/lib/python3.8/site-packages/torch/serialization.py", line 1002, in _legacy_load
magic_number = pickle_module.load(f, **pickle_load_args)
_pickle.UnpicklingError: invalid load key, 'v'.

@G-z-w
Copy link
Collaborator

G-z-w commented Jul 26, 2023

Please ensure that the model_zoo/sam_vit_h_4b8939.pth file has been successfully downloaded. You can remove the pth file and download it again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants