描述问题
我按照https://huggingface.co/Tencent-Hunyuan/TensorRT-libs中的教程成功执行到最后一步报错:
Exception has occurred: PolygraphyException
Could not deserialize engine. See log for details.
File "/home/zan/HunyuanDiT/hydit/modules/trt/engine.py", line 89, in activate
self.engine = engine_from_bytes(bytes_from_path(self.engine_path))
File "/home/zan/HunyuanDiT/hydit/modules/trt/hcf_model.py", line 34, in init
self.engine.activate(plugin_path)
File "/home/zan/HunyuanDiT/hydit/inference.py", line 240, in init
self.model = TRTModel(model_name=model_name,
File "/home/zan/HunyuanDiT/sample_t2i.py", line 17, in inferencer
gen = End2End(args, models_root_path)
File "/home/zan/HunyuanDiT/sample_t2i.py", line 31, in
args, gen, enhancer = inferencer()
polygraphy.exception.exception.PolygraphyException: Could not deserialize engine. See log for details.
重现步骤
您运行了什么命令或脚本?
python sample_t2i.py --infer-mode trt --prompt “渔舟唱晚” --no-enhance --infer-steps 100
您运行的配置目录是什么?
默认配置。
您是否对代码或配置进行了任何修改?您是否理解您所修改的内容?
没有做修改。
您使用了什么数据集?
没有使用数据集。
环境
请运行 python utils/collect_env.py 收集必要的环境信息并粘贴在此。
sys.platform: linux
Python: 3.8.12 (default, Oct 12 2021, 13:49:34) [GCC 7.5.0]
CUDA available: True
MUSA available: False
numpy_random_seed: 2147483648
GPU 0,1,2,3: NVIDIA A10
CUDA_HOME: /usr/local/cuda
NVCC: Cuda compilation tools, release 11.7, V11.7.99
GCC: gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0
PyTorch: 1.13.1+cu117
PyTorch compiling details: PyTorch built with:
GCC 9.3
C++ Version: 201402
Intel(R) Math Kernel Library Version 2020.0.0 Product Build 20191122 for Intel(R) 64 architecture applications
描述问题 我按照https://huggingface.co/Tencent-Hunyuan/TensorRT-libs中的教程成功执行到最后一步报错: Exception has occurred: PolygraphyException Could not deserialize engine. See log for details. File "/home/zan/HunyuanDiT/hydit/modules/trt/engine.py", line 89, in activate self.engine = engine_from_bytes(bytes_from_path(self.engine_path)) File "/home/zan/HunyuanDiT/hydit/modules/trt/hcf_model.py", line 34, in init self.engine.activate(plugin_path) File "/home/zan/HunyuanDiT/hydit/inference.py", line 240, in init self.model = TRTModel(model_name=model_name, File "/home/zan/HunyuanDiT/sample_t2i.py", line 17, in inferencer gen = End2End(args, models_root_path) File "/home/zan/HunyuanDiT/sample_t2i.py", line 31, in
args, gen, enhancer = inferencer()
polygraphy.exception.exception.PolygraphyException: Could not deserialize engine. See log for details.
重现步骤
环境
请运行 python utils/collect_env.py 收集必要的环境信息并粘贴在此。 sys.platform: linux Python: 3.8.12 (default, Oct 12 2021, 13:49:34) [GCC 7.5.0] CUDA available: True MUSA available: False numpy_random_seed: 2147483648 GPU 0,1,2,3: NVIDIA A10 CUDA_HOME: /usr/local/cuda NVCC: Cuda compilation tools, release 11.7, V11.7.99 GCC: gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0 PyTorch: 1.13.1+cu117 PyTorch compiling details: PyTorch built with:
您可以添加其他有助于定位问题的信息,例如 Package Version
accelerate 0.29.3 addict 2.4.0 aiofiles 23.2.1 aiohttp 3.9.5 aiosignal 1.3.1 aliyun-python-sdk-core 2.15.1 aliyun-python-sdk-kms 2.16.3 altair 5.3.0 annotated-types 0.7.0 anyio 4.4.0 async-timeout 4.0.3 attrs 23.2.0 bcrypt 4.1.3 blessed 1.20.0 build 1.2.1 CacheControl 0.14.0 certifi 2024.6.2 cffi 1.16.0 charset-normalizer 3.3.2 cleo 2.1.0 click 8.1.7 colored 1.4.4 coloredlogs 15.0.1 contourpy 1.1.1 crashtest 0.4.1 crcmod 1.7 cryptography 42.0.8 cuda-python 11.7.1 cycler 0.12.1 Cython 3.0.10 dacite 1.8.1 datasets 2.18.0 decorator 5.1.1 deepspeed 0.6.3 Deprecated 1.2.14 diffusers 0.21.2 dill 0.3.8 distlib 0.3.8 dnspython 2.6.1 dulwich 0.21.7 einops 0.7.0 email_validator 2.1.2 exceptiongroup 1.2.1 fabric 3.2.2 fastapi 0.111.0 fastapi-cli 0.0.4 fastjsonschema 2.20.0 ffmpy 0.3.2 filelock 3.15.1 flash-attn 2.1.2.post3 flatbuffers 24.3.25 fonttools 4.53.0 frozenlist 1.4.1 fsspec 2024.2.0 gast 0.5.4 gpustat 1.1.1 gradio 3.50.2 gradio_client 0.6.1 h11 0.14.0 hjson 3.1.0 httpcore 1.0.5 httptools 0.6.1 httpx 0.27.0 huggingface-hub 0.23.4 humanfriendly 10.0 idna 3.7 importlib_metadata 7.1.0 importlib_resources 6.4.0 inquirerpy 0.3.4 installer 0.7.0 invoke 2.2.0 jaraco.classes 3.4.0 jeepney 0.8.0 Jinja2 3.1.4 jmespath 0.10.0 jsonschema 4.22.0 jsonschema-specifications 2023.12.1 keyring 24.3.1 kiwisolver 1.4.5 loguru 0.7.2 markdown-it-py 3.0.0 MarkupSafe 2.1.5 matplotlib 3.7.5 mdurl 0.1.2 modelscope 1.15.0 more-itertools 10.3.0 mpmath 1.3.0 msgpack 1.0.8 multidict 6.0.5 multiprocess 0.70.16 ninja 1.11.1.1 numpy 1.24.4 nvidia-cublas-cu12 12.5.2.13 nvidia-cuda-runtime-cu12 12.5.39 nvidia-cudnn-cu12 9.1.1.17 nvidia-ml-py 12.555.43 nvidia-pyindex 1.0.9 onnx 1.16.1 onnx_graphsurgeon 0.3.29 onnxruntime 1.12.1 orjson 3.10.5 oss2 2.18.6 packaging 24.1 pandas 2.0.3 paramiko 3.4.0 peft 0.10.0 pexpect 4.9.0 pfzy 0.3.4 pillow 10.3.0 pip 24.0 pkginfo 1.11.1 pkgutil_resolve_name 1.3.10 platformdirs 4.2.2 poetry 1.8.3 poetry-core 1.9.0 poetry-plugin-export 1.8.0 polygraphy 0.47.1 prompt_toolkit 3.0.47 protobuf 5.27.1 psutil 5.9.8 ptyprocess 0.7.0 py-cpuinfo 9.0.0 pyarrow 16.1.0 pyarrow-hotfix 0.6 pycparser 2.22 pycryptodome 3.20.0 pydantic 2.7.4 pydantic_core 2.18.4 pydub 0.25.1 Pygments 2.18.0 PyNaCl 1.5.0 pyOpenSSL 24.1.0 pyparsing 3.1.2 pyproject_hooks 1.1.0 python-dateutil 2.9.0.post0 python-dotenv 1.0.1 python-multipart 0.0.9 pytz 2024.1 PyYAML 6.0.1 rapidfuzz 3.9.3 referencing 0.35.1 regex 2024.5.15 requests 2.32.3 requests-toolbelt 1.0.0 rich 13.7.1 rpds-py 0.18.1 safetensors 0.4.3 scipy 1.10.1 SecretStorage 3.3.3 semantic-version 2.10.0 sentencepiece 0.1.99 setuptools 69.5.1 shellingham 1.5.4 simplejson 3.19.2 six 1.16.0 sniffio 1.3.1 sortedcontainers 2.4.0 starlette 0.37.2 sympy 1.12.1 tensorrt 8.6.0 timm 0.9.5 tokenizers 0.15.2 tomli 2.0.1 tomlkit 0.12.5 toolz 0.12.1 torch 1.13.1+cu117 torchvision 0.14.1 tqdm 4.66.4 transformers 4.39.1 trove-classifiers 2024.5.22 typer 0.12.3 typing_extensions 4.12.2 tzdata 2024.1 ujson 5.10.0 urllib3 2.2.2 uvicorn 0.30.1 uvloop 0.19.0 virtualenv 20.26.2 watchfiles 0.22.0 wcwidth 0.2.13 websockets 11.0.3 wheel 0.43.0 wrapt 1.16.0 xxhash 3.4.1 yapf 0.40.2 yarl 1.9.4 zipp 3.19.2
请求解答,不胜感激!