登录
注册
开源
企业版
高校版
搜索
帮助中心
使用条款
关于我们
开源
企业版
高校版
私有云
模力方舟
AI 队友
登录
注册
6 月10 日(本周三晚 19:00)直播预告:龙虾还活着吗?来看 PocketClaw 上市两个月后对 AI 硬件的真实复盘,点击预约,开播有提醒~
代码拉取完成,页面将自动刷新
仓库状态说明
捐赠
捐赠前请先登录
取消
前往登录
扫描微信二维码支付
取消
支付完成
支付提示
将跳转至支付宝完成支付
确定
取消
Watch
不关注
关注所有动态
仅关注版本发行动态
关注但不提醒动态
60
Star
610
Fork
1.4K
Ascend
/
ModelZoo-PyTorch
暂停
代码
Issues
523
Pull Requests
200
Wiki
统计
流水线
服务
质量分析
Jenkins for Gitee
腾讯云托管
腾讯云 Serverless
悬镜安全
阿里云 SAE
Codeblitz
SBOM
开发画像分析
我知道了,不再自动展开
更新失败,请稍后重试!
移除标识
内容风险标识
本任务被
标识为内容中包含有代码安全 Bug 、隐私泄露等敏感信息,仓库外成员不可访问
Flux.1-DEV执行python inference_flux.py报错ImportError: cannot import name 'CacheAgent' from 'mindiesd' (/usr/local/lib/python3.11/site-packages/mindiesd/__init__.py)
DONE
#IC4095
缺陷
DQ2025
创建于
2025-04-25 17:02
一、问题现象(附报错日志上下文): 参照此文档 https://gitee.com/ascend/ModelZoo-PyTorch/tree/master/MindIE/MultiModal/Flux.1-DEV 执行Flux推理操作(3.2.1 Atlas-800I-A2-64g机器运行Flux)时报错: ImportError: cannot import name 'CacheAgent' from 'mindiesd' (/usr/local/lib/python3.11/site-packages/mindiesd/__init__.py) 二、软件版本: -- 硬件:Atlas-800I-A2-64g -- 镜像:2.0.T3.1-800I-A2-py311-openeuler24.03-lts -- CANN 版本 (e.g., CANN 3.0.x,5.x.x): 8.0.T63 -- Tensorflow/Pytorch/MindSpore 版本: Pytorch 2.1.0 -- Python 版本 (e.g., Python 3.7.5): 3.11.6 -- MindStudio版本 (e.g., MindStudio 2.0.0 (beta3)): -- 操作系统版本 (e.g., Ubuntu 18.04): openeuler24.03 -- MINDIE相关包的版本: mindie_llm 2.0a3 mindiebenchmark 2.0a3 mindieclient 2.0a3 mindiesd 2.0a3 mindietorch 2.0a3+torch2.1.0.abi0 三、测试步骤: 按文档执行至3.2.1 Atlas-800I-A2-64g机器运行Flux步骤,运行脚本如下: python inference_flux.py \ --path "/data/models/FLUX.1-dev" \ --save_path "./res" \ --device_id 6 \ --device "npu" \ --prompt_path "./prompts.txt" \ --width 1024 \ --height 1024 \ --infer_steps 50 \ --seed 42 \ --use_cache \ --device_type "A2-64g" \ --batch_size 1 报错如下: ImportError: cannot import name 'CacheAgent' from 'mindiesd' (/usr/local/lib/python3.11/site-packages/mindiesd/__init__.py) 四、日志信息: /usr/local/lib64/python3.11/site-packages/torch_npu/contrib/transfer_to_npu.py:294: ImportWarning: ************************************************************************************************************* The torch.Tensor.cuda and torch.nn.Module.cuda are replaced with torch.Tensor.npu and torch.nn.Module.npu now.. The torch.cuda.DoubleTensor is replaced with torch.npu.FloatTensor cause the double type is not supported now.. The backend in torch.distributed.init_process_group set to hccl now.. The torch.cuda.* and torch.cuda.amp.* are replaced with torch.npu.* and torch.npu.amp.* now.. The device parameters have been replaced with npu in the function below: torch.logspace, torch.randint, torch.hann_window, torch.rand, torch.full_like, torch.ones_like, torch.rand_like, torch.randperm, torch.arange, torch.frombuffer, torch.normal, torch._empty_per_channel_affine_quantized, torch.empty_strided, torch.empty_like, torch.scalar_tensor, torch.tril_indices, torch.bartlett_window, torch.ones, torch.sparse_coo_tensor, torch.randn, torch.kaiser_window, torch.tensor, torch.triu_indices, torch.as_tensor, torch.zeros, torch.randint_like, torch.full, torch.eye, torch._sparse_csr_tensor_unsafe, torch.empty, torch._sparse_coo_tensor_unsafe, torch.blackman_window, torch.zeros_like, torch.range, torch.sparse_csr_tensor, torch.randn_like, torch.from_file, torch._cudnn_init_dropout_state, torch._empty_affine_quantized, torch.linspace, torch.hamming_window, torch.empty_quantized, torch._pin_memory, torch.autocast, torch.load, torch.Generator, torch.set_default_device, torch.Tensor.new_empty, torch.Tensor.new_empty_strided, torch.Tensor.new_full, torch.Tensor.new_ones, torch.Tensor.new_tensor, torch.Tensor.new_zeros, torch.Tensor.to, torch.nn.Module.to, torch.nn.Module.to_empty ************************************************************************************************************* warnings.warn(msg, ImportWarning) /usr/local/lib64/python3.11/site-packages/torch_npu/contrib/transfer_to_npu.py:249: RuntimeWarning: torch.jit.script and torch.jit.script_method will be disabled by transfer_to_npu, which currently does not support them, if you need to enable them, please do not use transfer_to_npu. warnings.warn(msg, RuntimeWarning) /usr/local/lib64/python3.11/site-packages/torch/utils/cpp_extension.py:28: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html from pkg_resources import packaging # type: ignore[attr-defined] /usr/lib/python3.11/site-packages/pkg_resources/__init__.py:2871: DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('google')`. Implementing implicit namespace packages (as specified in PEP 420) is preferred to `pkg_resources.declare_namespace`. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages declare_namespace(pkg) /usr/lib/python3.11/site-packages/pkg_resources/__init__.py:2871: DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('zope')`. Implementing implicit namespace packages (as specified in PEP 420) is preferred to `pkg_resources.declare_namespace`. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages declare_namespace(pkg) Traceback (most recent call last): File "/data/models/FLUX.1-dev/mindie/inference_flux.py", line 27, in <module> from mindiesd import CacheAgent, CacheConfig ImportError: cannot import name 'CacheAgent' from 'mindiesd' (/usr/local/lib/python3.11/site-packages/mindiesd/__init__.py) [ERROR] 2025-04-25-17:02:05 (PID:1602, Device:-1, RankID:-1) ERR99999 UNKNOWN application exception /usr/lib64/python3.11/tempfile.py:904: ResourceWarning: Implicitly cleaning up <TemporaryDirectory '/tmp/tmpjbu1jjh3'> _warnings.warn(warn_message, ResourceWarning)
一、问题现象(附报错日志上下文): 参照此文档 https://gitee.com/ascend/ModelZoo-PyTorch/tree/master/MindIE/MultiModal/Flux.1-DEV 执行Flux推理操作(3.2.1 Atlas-800I-A2-64g机器运行Flux)时报错: ImportError: cannot import name 'CacheAgent' from 'mindiesd' (/usr/local/lib/python3.11/site-packages/mindiesd/__init__.py) 二、软件版本: -- 硬件:Atlas-800I-A2-64g -- 镜像:2.0.T3.1-800I-A2-py311-openeuler24.03-lts -- CANN 版本 (e.g., CANN 3.0.x,5.x.x): 8.0.T63 -- Tensorflow/Pytorch/MindSpore 版本: Pytorch 2.1.0 -- Python 版本 (e.g., Python 3.7.5): 3.11.6 -- MindStudio版本 (e.g., MindStudio 2.0.0 (beta3)): -- 操作系统版本 (e.g., Ubuntu 18.04): openeuler24.03 -- MINDIE相关包的版本: mindie_llm 2.0a3 mindiebenchmark 2.0a3 mindieclient 2.0a3 mindiesd 2.0a3 mindietorch 2.0a3+torch2.1.0.abi0 三、测试步骤: 按文档执行至3.2.1 Atlas-800I-A2-64g机器运行Flux步骤,运行脚本如下: python inference_flux.py \ --path "/data/models/FLUX.1-dev" \ --save_path "./res" \ --device_id 6 \ --device "npu" \ --prompt_path "./prompts.txt" \ --width 1024 \ --height 1024 \ --infer_steps 50 \ --seed 42 \ --use_cache \ --device_type "A2-64g" \ --batch_size 1 报错如下: ImportError: cannot import name 'CacheAgent' from 'mindiesd' (/usr/local/lib/python3.11/site-packages/mindiesd/__init__.py) 四、日志信息: /usr/local/lib64/python3.11/site-packages/torch_npu/contrib/transfer_to_npu.py:294: ImportWarning: ************************************************************************************************************* The torch.Tensor.cuda and torch.nn.Module.cuda are replaced with torch.Tensor.npu and torch.nn.Module.npu now.. The torch.cuda.DoubleTensor is replaced with torch.npu.FloatTensor cause the double type is not supported now.. The backend in torch.distributed.init_process_group set to hccl now.. The torch.cuda.* and torch.cuda.amp.* are replaced with torch.npu.* and torch.npu.amp.* now.. The device parameters have been replaced with npu in the function below: torch.logspace, torch.randint, torch.hann_window, torch.rand, torch.full_like, torch.ones_like, torch.rand_like, torch.randperm, torch.arange, torch.frombuffer, torch.normal, torch._empty_per_channel_affine_quantized, torch.empty_strided, torch.empty_like, torch.scalar_tensor, torch.tril_indices, torch.bartlett_window, torch.ones, torch.sparse_coo_tensor, torch.randn, torch.kaiser_window, torch.tensor, torch.triu_indices, torch.as_tensor, torch.zeros, torch.randint_like, torch.full, torch.eye, torch._sparse_csr_tensor_unsafe, torch.empty, torch._sparse_coo_tensor_unsafe, torch.blackman_window, torch.zeros_like, torch.range, torch.sparse_csr_tensor, torch.randn_like, torch.from_file, torch._cudnn_init_dropout_state, torch._empty_affine_quantized, torch.linspace, torch.hamming_window, torch.empty_quantized, torch._pin_memory, torch.autocast, torch.load, torch.Generator, torch.set_default_device, torch.Tensor.new_empty, torch.Tensor.new_empty_strided, torch.Tensor.new_full, torch.Tensor.new_ones, torch.Tensor.new_tensor, torch.Tensor.new_zeros, torch.Tensor.to, torch.nn.Module.to, torch.nn.Module.to_empty ************************************************************************************************************* warnings.warn(msg, ImportWarning) /usr/local/lib64/python3.11/site-packages/torch_npu/contrib/transfer_to_npu.py:249: RuntimeWarning: torch.jit.script and torch.jit.script_method will be disabled by transfer_to_npu, which currently does not support them, if you need to enable them, please do not use transfer_to_npu. warnings.warn(msg, RuntimeWarning) /usr/local/lib64/python3.11/site-packages/torch/utils/cpp_extension.py:28: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html from pkg_resources import packaging # type: ignore[attr-defined] /usr/lib/python3.11/site-packages/pkg_resources/__init__.py:2871: DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('google')`. Implementing implicit namespace packages (as specified in PEP 420) is preferred to `pkg_resources.declare_namespace`. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages declare_namespace(pkg) /usr/lib/python3.11/site-packages/pkg_resources/__init__.py:2871: DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('zope')`. Implementing implicit namespace packages (as specified in PEP 420) is preferred to `pkg_resources.declare_namespace`. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages declare_namespace(pkg) Traceback (most recent call last): File "/data/models/FLUX.1-dev/mindie/inference_flux.py", line 27, in <module> from mindiesd import CacheAgent, CacheConfig ImportError: cannot import name 'CacheAgent' from 'mindiesd' (/usr/local/lib/python3.11/site-packages/mindiesd/__init__.py) [ERROR] 2025-04-25-17:02:05 (PID:1602, Device:-1, RankID:-1) ERR99999 UNKNOWN application exception /usr/lib64/python3.11/tempfile.py:904: ResourceWarning: Implicitly cleaning up <TemporaryDirectory '/tmp/tmpjbu1jjh3'> _warnings.warn(warn_message, ResourceWarning)
评论 (
1
)
登录
后才可以发表评论
状态
DONE
TODO
WIP
DONE
CLOSED
REJECTED
负责人
未设置
标签
未设置
项目
未立项任务
未立项任务
里程碑
未关联里程碑
未关联里程碑
Pull Requests
未关联
未关联
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
未关联
分支 (
-
)
标签 (
-
)
开始日期   -   截止日期
-
置顶选项
不置顶
置顶等级:高
置顶等级:中
置顶等级:低
优先级
不指定
严重
主要
次要
不重要
预计工期
(小时)
参与者(2)
Python
1
https://gitee.com/ascend/ModelZoo-PyTorch.git
git@gitee.com:ascend/ModelZoo-PyTorch.git
ascend
ModelZoo-PyTorch
ModelZoo-PyTorch
点此查找更多帮助
搜索帮助
Git 命令在线学习
如何在 Gitee 导入 GitHub 仓库
Git 仓库基础操作
企业版和社区版功能对比
SSH 公钥设置
如何处理代码冲突
仓库体积过大,如何减小?
如何找回被删除的仓库数据
Gitee 产品配额说明
GitHub仓库快速导入Gitee及同步更新
什么是 Release(发行版)
将 PHP 项目自动发布到 packagist.org
仓库举报
回到顶部
登录提示
该操作需登录 Gitee 帐号,请先登录后再操作。
立即登录
没有帐号,去注册