InternLM / InternLM-XComposer

InternLM-XComposer2 is a groundbreaking vision-language large model (VLLM) excelling in free-form text-image composition and comprehension.
1.92k stars 121 forks source link

AttributeError: 'InternLM2ForCausalLM' object has no attribute 'vit' #243

Open autumn-moon-py opened 3 months ago

autumn-moon-py commented 3 months ago

控制台日志

(demo) D:\project\InternLM-XComposer>python examples/gradio_demo_composition.py --code_path D:\project\text-generation-webui\models\internlm2-chat-7b --private --num_gpus 1
Loading checkpoint shards: 100%|██████████████████████████████████████████████████████████████████████████████████████████████| 8/8 [00:26<00:00,  3.26s/it]
Traceback (most recent call last):
  File "D:\project\InternLM-XComposer\examples\gradio_demo_composition.py", line 842, in <module>
    demo_ui = Demo_UI(args.code_path, args.num_gpus)
  File "D:\project\InternLM-XComposer\examples\gradio_demo_composition.py", line 157, in __init__
    self.model.vit.resize_pos()
  File "D:\develop\miniconda\envs\demo\lib\site-packages\torch\nn\modules\module.py", line 1614, in __getattr__
    raise AttributeError("'{}' object has no attribute '{}'".format(
AttributeError: 'InternLM2ForCausalLM' object has no attribute 'vit'

这个7b在其他项目跑过了,能正常加载并推理的