[GH-ISSUE #72] about inference error #57

Open
opened 2026-10-26 21:10:59 +00:00 by bsakaguchi · 6 comments
Owner

Originally created by @cwt000297 on GitHub (Feb 11, 2025).
Original GitHub issue: https://github.com/deepseek-ai/DeepSeek-VL2/issues/72

Exception: data did not match any variant of untagged enum ModelWrapper at line 646517 column 3

Image

Originally created by @cwt000297 on GitHub (Feb 11, 2025). Original GitHub issue: https://github.com/deepseek-ai/DeepSeek-VL2/issues/72 Exception: data did not match any variant of untagged enum ModelWrapper at line 646517 column 3 ![Image](https://github.com/user-attachments/assets/a57fc2f7-e0cf-470a-b260-23bfdd822f75)
Author
Owner

@HubHop commented on GitHub (Feb 13, 2025):

Hi @cwt000297, I might be able to help further if you can provide more context.

<!-- gh-comment-id:2656066818 --> @HubHop commented on GitHub (Feb 13, 2025): Hi @cwt000297, I might be able to help further if you can provide more context.
Author
Owner

@liu-97max commented on GitHub (Feb 19, 2025):

@HubHop hi 我将deepseek-vl2做了lora微调后推理,遇到了相同的报错:
File "/opt/conda/envs/swift38/lib/python3.8/site-packages/transformers/tokenization_utils_fast.py", line 111, in init
fast_tokenizer = TokenizerFast.from_file(fast_tokenizer_file)
Exception: data did not match any variant of untagged enum ModelWrapper at line 646517 column 3

<!-- gh-comment-id:2667503806 --> @liu-97max commented on GitHub (Feb 19, 2025): @HubHop hi 我将deepseek-vl2做了lora微调后推理,遇到了相同的报错: File "/opt/conda/envs/swift38/lib/python3.8/site-packages/transformers/tokenization_utils_fast.py", line 111, in __init__ fast_tokenizer = TokenizerFast.from_file(fast_tokenizer_file) Exception: data did not match any variant of untagged enum ModelWrapper at line 646517 column 3
Author
Owner

@liu-97max commented on GitHub (Feb 19, 2025):

@HubHop你好,我将deepseek-vl2做了lora感知后推理,遇到了相同的报错:File "/opt/conda/envs/swift38/lib/python3.8/site-packages/transformers/tokenization_utils_fast.py", line 111, in init fast_tokenizer = TokenizerFast.from_file(fast_tokenizer_file) Exception: data did not match anyvariant of untagged enum ModelWrapper 位于第 646517 行第 3 列

微调:torch: 2.5.1+cu121, transformers: 4.47.1, xformers: 0.0.28.post3,timm: 1.0.14
推理:torch==2.0.1,transformers==4.38.2,xformers:0.0.22,timm: 1.0.14

<!-- gh-comment-id:2667509274 --> @liu-97max commented on GitHub (Feb 19, 2025): > [@HubHop](https://github.com/HubHop)你好,我将deepseek-vl2做了lora感知后推理,遇到了相同的报错:File "/opt/conda/envs/swift38/lib/python3.8/site-packages/transformers/tokenization_utils_fast.py", line 111, in init fast_tokenizer = TokenizerFast.from_file(fast_tokenizer_file) Exception: data did not match anyvariant **of** untagged enum ModelWrapper 位于第 646517 行第 3 列 微调:torch: 2.5.1+cu121, transformers: 4.47.1, xformers: 0.0.28.post3,timm: 1.0.14 推理:torch==2.0.1,transformers==4.38.2,xformers:0.0.22,timm: 1.0.14
Author
Owner

@liu-97max commented on GitHub (Feb 20, 2025):

@HubHophi好,我将deepseek-vl2做了lora感知后推理,遇到了相同的报错:File "/opt/conda/envs/swift38/lib/python3.8/site-packages/transformers/tokenization_utils_fast.py", line 111, in init fast_tokenizer = TokenizerFast.from_file(fast_tokenizer_file) Exception: data did not match未标记枚举 ModelWrapper的任何变体位于第 646517 行第 3 列

扭矩:torch: 2.5.1+cu121,transformers: 4.47.1, xformers: 0.0.28.post3,timm: 1.0.14 推理:torch==2.0.1,transformers==4.38.2,xformers:0.0.22,timm: 1.0.14

已解决,transformers==4.41.1

<!-- gh-comment-id:2670370386 --> @liu-97max commented on GitHub (Feb 20, 2025): > > [@HubHophi](https://github.com/HubHop)好,我将deepseek-vl2做了lora感知后推理,遇到了相同的报错:File "/opt/conda/envs/swift38/lib/python3.8/site-packages/transformers/tokenization_utils_fast.py", line 111, in init fast_tokenizer = TokenizerFast.from_file(fast_tokenizer_file) Exception: data did not match未标记枚举 ModelWrapper**的**任何变体位于第 646517 行第 3 列 > > 扭矩:torch: 2.5.1+cu121,transformers: 4.47.1, xformers: 0.0.28.post3,timm: 1.0.14 推理:torch==2.0.1,transformers==4.38.2,xformers:0.0.22,timm: 1.0.14 已解决,transformers==4.41.1
Author
Owner

@Jackson-cj commented on GitHub (Apr 7, 2025):

Ask for help, below is my relevant information, very grateful!!
[INFO:swift] Loading the model using model_dir: /remote-home/cs_acmis_hby/LLM/deepseek-vl2-merge01
[INFO:swift] local_repo_path: /root/.cache/modelscope/hub/_github/DeepSeek-VL2
Python version is above 3.10, patching the collections module.
Traceback (most recent call last):
File "/root/anaconda3/envs/deepseek-vl2/lib/python3.10/site-packages/swift/cli/infer.py", line 5, in
infer_main()
File "/root/anaconda3/envs/deepseek-vl2/lib/python3.10/site-packages/swift/llm/infer/infer.py", line 208, in infer_main
return SwiftInfer(args).main()
File "/root/anaconda3/envs/deepseek-vl2/lib/python3.10/site-packages/swift/llm/infer/infer.py", line 35, in init
model, self.template = prepare_model_template(args)
File "/root/anaconda3/envs/deepseek-vl2/lib/python3.10/site-packages/swift/llm/infer/utils.py", line 144, in prepare_model_template
model, processor = args.get_model_processor(**kwargs)
File "/root/anaconda3/envs/deepseek-vl2/lib/python3.10/site-packages/swift/llm/argument/base_args/base_args.py", line 259, in get_model_processor
model, processor = get_model_tokenizer(**kwargs, model_kwargs=model_kwargs)
File "/root/anaconda3/envs/deepseek-vl2/lib/python3.10/site-packages/swift/llm/model/register.py", line 497, in get_model_tokenizer
model, processor = get_function(model_dir, model_info, model_kwargs, load_model, **kwargs)
File "/root/anaconda3/envs/deepseek-vl2/lib/python3.10/site-packages/swift/llm/model/model/deepseek.py", line 198, in get_model_tokenizer_deepseek_vl2
processor: DeepseekVLV2Processor = DeepseekVLV2Processor.from_pretrained(model_dir)
File "/root/anaconda3/envs/deepseek-vl2/lib/python3.10/site-packages/transformers/processing_utils.py", line 465, in from_pretrained
args = cls._get_arguments_from_pretrained(pretrained_model_name_or_path, **kwargs)
File "/root/anaconda3/envs/deepseek-vl2/lib/python3.10/site-packages/transformers/processing_utils.py", line 511, in _get_arguments_from_pretrained
args.append(attribute_class.from_pretrained(pretrained_model_name_or_path, **kwargs))
File "/root/anaconda3/envs/deepseek-vl2/lib/python3.10/site-packages/transformers/tokenization_utils_base.py", line 2110, in from_pretrained
return cls._from_pretrained(
File "/root/anaconda3/envs/deepseek-vl2/lib/python3.10/site-packages/transformers/tokenization_utils_base.py", line 2336, in _from_pretrained
tokenizer = cls(*init_inputs, **init_kwargs)
File "/root/anaconda3/envs/deepseek-vl2/lib/python3.10/site-packages/transformers/models/llama/tokenization_llama_fast.py", line 156, in init
super().init(
File "/root/anaconda3/envs/deepseek-vl2/lib/python3.10/site-packages/transformers/tokenization_utils_fast.py", line 114, in init
fast_tokenizer = TokenizerFast.from_file(fast_tokenizer_file)
Exception: data did not match any variant of untagged enum ModelWrapper at line 646517 column 3

Name: torch
Version: 2.0.1
Summary: Tensors and Dynamic neural networks in Python with strong GPU acceleration
Home-page: https://pytorch.org/
Author: PyTorch Team
Author-email: packages@pytorch.org
License: BSD-3
Location: /root/anaconda3/envs/deepseek-vl2/lib/python3.10/site-packages
Requires: filelock, jinja2, networkx, nvidia-cublas-cu11, nvidia-cuda-cupti-cu11, nvidia-cuda-nvrtc-cu11, nvidia-cuda-runtime-cu11, nvidia-cudnn-cu11, nvidia-cufft-cu11, nvidia-curand-cu11, nvidia-cusolver-cu11, nvidia-cusparse-cu11, nvidia-nccl-cu11, nvidia-nvtx-cu11, sympy, triton, typing-extensions
Required-by: accelerate, bitsandbytes, deepspeed, evalscope, ms-opencompass, ms-vlmeval, mteb, peft, sentence-transformers, timm, torchaudio, torchvision, triton, trl, xformers, xtuner

Name: transformers
Version: 4.47.1
Summary: State-of-the-art Machine Learning for JAX, PyTorch and TensorFlow
Home-page: https://github.com/huggingface/transformers
Author: The Hugging Face team (past and future) with the help of all our contributors (https://github.com/huggingface/transformers/graphs/contributors)
Author-email: transformers@huggingface.co
License: Apache 2.0 License
Location: /root/anaconda3/envs/deepseek-vl2/lib/python3.10/site-packages
Requires: filelock, huggingface-hub, numpy, packaging, pyyaml, regex, requests, safetensors, tokenizers, tqdm
Required-by: evalscope, ms-opencompass, ms-swift, ms-vlmeval, peft, sentence-transformers, transformers-stream-generator, trl, xtuner

Name: xformers
Version: 0.0.22
Summary: XFormers: A collection of composable Transformer building blocks.
Home-page: https://facebookresearch.github.io/xformers/
Author: Facebook AI Research
Author-email: oncall+xformers@xmail.facebook.com
License:
Location: /root/anaconda3/envs/deepseek-vl2/lib/python3.10/site-packages
Requires: numpy, torch
Required-by:

Name: timm
Version: 1.0.14
Summary: PyTorch Image Models
Home-page: https://github.com/huggingface/pytorch-image-models
Author:
Author-email: Ross Wightman ross@huggingface.co
License: Apache-2.0
Location: /root/anaconda3/envs/deepseek-vl2/lib/python3.10/site-packages
Requires: huggingface_hub, pyyaml, safetensors, torch, torchvision
Required-by:

<!-- gh-comment-id:2783654598 --> @Jackson-cj commented on GitHub (Apr 7, 2025): Ask for help, below is my relevant information, very grateful!! [INFO:swift] Loading the model using model_dir: /remote-home/cs_acmis_hby/LLM/deepseek-vl2-merge01 [INFO:swift] local_repo_path: /root/.cache/modelscope/hub/_github/DeepSeek-VL2 Python version is above 3.10, patching the collections module. Traceback (most recent call last): File "/root/anaconda3/envs/deepseek-vl2/lib/python3.10/site-packages/swift/cli/infer.py", line 5, in <module> infer_main() File "/root/anaconda3/envs/deepseek-vl2/lib/python3.10/site-packages/swift/llm/infer/infer.py", line 208, in infer_main return SwiftInfer(args).main() File "/root/anaconda3/envs/deepseek-vl2/lib/python3.10/site-packages/swift/llm/infer/infer.py", line 35, in __init__ model, self.template = prepare_model_template(args) File "/root/anaconda3/envs/deepseek-vl2/lib/python3.10/site-packages/swift/llm/infer/utils.py", line 144, in prepare_model_template model, processor = args.get_model_processor(**kwargs) File "/root/anaconda3/envs/deepseek-vl2/lib/python3.10/site-packages/swift/llm/argument/base_args/base_args.py", line 259, in get_model_processor model, processor = get_model_tokenizer(**kwargs, model_kwargs=model_kwargs) File "/root/anaconda3/envs/deepseek-vl2/lib/python3.10/site-packages/swift/llm/model/register.py", line 497, in get_model_tokenizer model, processor = get_function(model_dir, model_info, model_kwargs, load_model, **kwargs) File "/root/anaconda3/envs/deepseek-vl2/lib/python3.10/site-packages/swift/llm/model/model/deepseek.py", line 198, in get_model_tokenizer_deepseek_vl2 processor: DeepseekVLV2Processor = DeepseekVLV2Processor.from_pretrained(model_dir) File "/root/anaconda3/envs/deepseek-vl2/lib/python3.10/site-packages/transformers/processing_utils.py", line 465, in from_pretrained args = cls._get_arguments_from_pretrained(pretrained_model_name_or_path, **kwargs) File "/root/anaconda3/envs/deepseek-vl2/lib/python3.10/site-packages/transformers/processing_utils.py", line 511, in _get_arguments_from_pretrained args.append(attribute_class.from_pretrained(pretrained_model_name_or_path, **kwargs)) File "/root/anaconda3/envs/deepseek-vl2/lib/python3.10/site-packages/transformers/tokenization_utils_base.py", line 2110, in from_pretrained return cls._from_pretrained( File "/root/anaconda3/envs/deepseek-vl2/lib/python3.10/site-packages/transformers/tokenization_utils_base.py", line 2336, in _from_pretrained tokenizer = cls(*init_inputs, **init_kwargs) File "/root/anaconda3/envs/deepseek-vl2/lib/python3.10/site-packages/transformers/models/llama/tokenization_llama_fast.py", line 156, in __init__ super().__init__( File "/root/anaconda3/envs/deepseek-vl2/lib/python3.10/site-packages/transformers/tokenization_utils_fast.py", line 114, in __init__ fast_tokenizer = TokenizerFast.from_file(fast_tokenizer_file) Exception: data did not match any variant of untagged enum ModelWrapper at line 646517 column 3 Name: torch Version: 2.0.1 Summary: Tensors and Dynamic neural networks in Python with strong GPU acceleration Home-page: https://pytorch.org/ Author: PyTorch Team Author-email: packages@pytorch.org License: BSD-3 Location: /root/anaconda3/envs/deepseek-vl2/lib/python3.10/site-packages Requires: filelock, jinja2, networkx, nvidia-cublas-cu11, nvidia-cuda-cupti-cu11, nvidia-cuda-nvrtc-cu11, nvidia-cuda-runtime-cu11, nvidia-cudnn-cu11, nvidia-cufft-cu11, nvidia-curand-cu11, nvidia-cusolver-cu11, nvidia-cusparse-cu11, nvidia-nccl-cu11, nvidia-nvtx-cu11, sympy, triton, typing-extensions Required-by: accelerate, bitsandbytes, deepspeed, evalscope, ms-opencompass, ms-vlmeval, mteb, peft, sentence-transformers, timm, torchaudio, torchvision, triton, trl, xformers, xtuner --- Name: transformers Version: 4.47.1 Summary: State-of-the-art Machine Learning for JAX, PyTorch and TensorFlow Home-page: https://github.com/huggingface/transformers Author: The Hugging Face team (past and future) with the help of all our contributors (https://github.com/huggingface/transformers/graphs/contributors) Author-email: transformers@huggingface.co License: Apache 2.0 License Location: /root/anaconda3/envs/deepseek-vl2/lib/python3.10/site-packages Requires: filelock, huggingface-hub, numpy, packaging, pyyaml, regex, requests, safetensors, tokenizers, tqdm Required-by: evalscope, ms-opencompass, ms-swift, ms-vlmeval, peft, sentence-transformers, transformers-stream-generator, trl, xtuner --- Name: xformers Version: 0.0.22 Summary: XFormers: A collection of composable Transformer building blocks. Home-page: https://facebookresearch.github.io/xformers/ Author: Facebook AI Research Author-email: oncall+xformers@xmail.facebook.com License: Location: /root/anaconda3/envs/deepseek-vl2/lib/python3.10/site-packages Requires: numpy, torch Required-by: --- Name: timm Version: 1.0.14 Summary: PyTorch Image Models Home-page: https://github.com/huggingface/pytorch-image-models Author: Author-email: Ross Wightman <ross@huggingface.co> License: Apache-2.0 Location: /root/anaconda3/envs/deepseek-vl2/lib/python3.10/site-packages Requires: huggingface_hub, pyyaml, safetensors, torch, torchvision Required-by:
Author
Owner

@Jackson-cj commented on GitHub (Apr 7, 2025):

Hi @cwt000297, I might be able to help further if you can provide more context.

I hope I can get your help. Thank you very much!

<!-- gh-comment-id:2783657674 --> @Jackson-cj commented on GitHub (Apr 7, 2025): > Hi [@cwt000297](https://github.com/cwt000297), I might be able to help further if you can provide more context. I hope I can get your help. Thank you very much!
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
deepseek-ai/DeepSeek-VL2#57
No description provided.