[GH-ISSUE #220] 当前项目 requirements.txt 的依赖声明无法运行模型,希望能尽快更新依赖说明 #180

Open
opened 2026-10-26 21:13:41 +00:00 by bsakaguchi · 0 comments
Owner

Originally created by @ra1n666k on GitHub (Jun 7, 2025).
Original GitHub issue: https://github.com/deepseek-ai/Janus/issues/220

当前项目 requirements.txt 的依赖声明 未涵盖 PyTorch 版本要求,请尽快更新,导致在我安装2.0.1的pytorch依赖后
python demo/app_januspro.py

运行时报错了,

Disabling PyTorch because PyTorch >= 2.1 is required but found 2.0.1+cu117
None of PyTorch, TensorFlow >= 2.0, or Flax have been found. Models won't be available and only tokenizers, configuration and file/data utilities can be used.
Python version is above 3.10, patching the collections module.
None of PyTorch, TensorFlow >= 2.0, or Flax have been found. Models won't be available and only tokenizers, configuration and file/data utilities can be used.
C:\Users\18051.conda\envs\gradio\lib\site-packages\torchvision\datapoints_init_.py:12: UserWarning: The torchvision.datapoints and torchvision.transforms.v2 namespaces are still Beta. While we do not expect major breaking changes, some APIs may still change according to user feedback. Please submit any feedback you may have in this issue: https://github.com/pytorch/vision/issues/6753, and you can also check out https://github.com/pytorch/vision/issues/7319 to learn more about the APIs that we suspect might involve future changes. You can silence this warning by calling torchvision.disable_beta_transforms_warning().
warnings.warn(BETA_TRANSFORMS_WARNING)
C:\Users\18051.conda\envs\gradio\lib\site-packages\torchvision\transforms\v2_init
.py:54: UserWarning: The torchvision.datapoints and torchvision.transforms.v2 namespaces are still Beta. While we do not expect major breaking changes, some APIs may still change according to user feedback. Please submit any feedback you may have in this issue: https://github.com/pytorch/vision/issues/6753, and you can also check out https://github.com/pytorch/vision/issues/7319 to learn more about the APIs that we suspect might involve future changes. You can silence this warning by calling torchvision.disable_beta_transforms_warning().
warnings.warn(BETA_TRANSFORMS_WARNING)
C:\Users\18051.conda\envs\gradio\lib\site-packages\transformers\models\auto\image_processing_auto.py:609: FutureWarning: The image_processor_class argument is deprecated and will be removed in v4.42. Please use slow_image_processor_class, or fast_image_processor_class instead
warnings.warn(
Traceback (most recent call last):
File "E:\Models\Janus\demo\app_januspro.py", line 4, in
from janus.models import MultiModalityCausalLM, VLChatProcessor
File "E:\Models\Janus\janus\models_init
.py", line 21, in
from .modeling_vlm import MultiModalityCausalLM
File "E:\Models\Janus\janus\models\modeling_vlm.py", line 272, in
AutoModelForCausalLM.register(MultiModalityConfig, MultiModalityCausalLM)
File "C:\Users\18051.conda\envs\gradio\lib\site-packages\transformers\utils\import_utils.py", line 1885, in getattribute
requires_backends(cls, cls._backends)
File "C:\Users\18051.conda\envs\gradio\lib\site-packages\transformers\utils\import_utils.py", line 1871, in requires_backends
raise ImportError("".join(failed))
ImportError:
AutoModelForCausalLM requires the PyTorch library but it was not found in your environment. Checkout the instructions on the
installation page: https://pytorch.org/get-started/locally/ and follow the ones that match your environment.
Please note that you may need to restart your runtime after installation.

另外还希望附上python的版本要求,3.11/3.12下部分轮子无法原生支持,如sentencepiece,需用python=3.10的环境

Originally created by @ra1n666k on GitHub (Jun 7, 2025). Original GitHub issue: https://github.com/deepseek-ai/Janus/issues/220 当前项目 requirements.txt 的依赖声明 未涵盖 PyTorch 版本要求,请尽快更新,导致在我安装2.0.1的pytorch依赖后 python demo/app_januspro.py 运行时报错了, Disabling PyTorch because PyTorch >= 2.1 is required but found 2.0.1+cu117 None of PyTorch, TensorFlow >= 2.0, or Flax have been found. Models won't be available and only tokenizers, configuration and file/data utilities can be used. Python version is above 3.10, patching the collections module. None of PyTorch, TensorFlow >= 2.0, or Flax have been found. Models won't be available and only tokenizers, configuration and file/data utilities can be used. C:\Users\18051\.conda\envs\gradio\lib\site-packages\torchvision\datapoints\__init__.py:12: UserWarning: The torchvision.datapoints and torchvision.transforms.v2 namespaces are still Beta. While we do not expect major breaking changes, some APIs may still change according to user feedback. Please submit any feedback you may have in this issue: https://github.com/pytorch/vision/issues/6753, and you can also check out https://github.com/pytorch/vision/issues/7319 to learn more about the APIs that we suspect might involve future changes. You can silence this warning by calling torchvision.disable_beta_transforms_warning(). warnings.warn(_BETA_TRANSFORMS_WARNING) C:\Users\18051\.conda\envs\gradio\lib\site-packages\torchvision\transforms\v2\__init__.py:54: UserWarning: The torchvision.datapoints and torchvision.transforms.v2 namespaces are still Beta. While we do not expect major breaking changes, some APIs may still change according to user feedback. Please submit any feedback you may have in this issue: https://github.com/pytorch/vision/issues/6753, and you can also check out https://github.com/pytorch/vision/issues/7319 to learn more about the APIs that we suspect might involve future changes. You can silence this warning by calling torchvision.disable_beta_transforms_warning(). warnings.warn(_BETA_TRANSFORMS_WARNING) C:\Users\18051\.conda\envs\gradio\lib\site-packages\transformers\models\auto\image_processing_auto.py:609: FutureWarning: The image_processor_class argument is deprecated and will be removed in v4.42. Please use `slow_image_processor_class`, or `fast_image_processor_class` instead warnings.warn( Traceback (most recent call last): File "E:\Models\Janus\demo\app_januspro.py", line 4, in <module> from janus.models import MultiModalityCausalLM, VLChatProcessor File "E:\Models\Janus\janus\models\__init__.py", line 21, in <module> from .modeling_vlm import MultiModalityCausalLM File "E:\Models\Janus\janus\models\modeling_vlm.py", line 272, in <module> AutoModelForCausalLM.register(MultiModalityConfig, MultiModalityCausalLM) File "C:\Users\18051\.conda\envs\gradio\lib\site-packages\transformers\utils\import_utils.py", line 1885, in __getattribute__ requires_backends(cls, cls._backends) File "C:\Users\18051\.conda\envs\gradio\lib\site-packages\transformers\utils\import_utils.py", line 1871, in requires_backends raise ImportError("".join(failed)) ImportError: AutoModelForCausalLM requires the PyTorch library but it was not found in your environment. Checkout the instructions on the installation page: https://pytorch.org/get-started/locally/ and follow the ones that match your environment. Please note that you may need to restart your runtime after installation. 另外还希望附上python的版本要求,3.11/3.12下部分轮子无法原生支持,如sentencepiece,需用python=3.10的环境
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/Janus#180
No description provided.