Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

运行paddle_infer.py报错 #975

Closed
magicleo opened this issue Jan 18, 2024 · 0 comments
Closed

运行paddle_infer.py报错 #975

magicleo opened this issue Jan 18, 2024 · 0 comments

Comments

@magicleo
Copy link

magicleo commented Jan 18, 2024

环境:
python 3.9
paddlepaddle-gpu
ubuntu 18.04
cuda11.7
tensorrt 8.5.3.1-1+cuda11.8 amd64 Meta package for TensorRT

1.修改models/rank/deepfm/config.yaml
use_inference: True

2.执行
python -u ../../../tools/static_trainer.py -m config.yaml
3. 执行
python -u ../../../tools/paddle_infer.py --model_file=output_model_deepfm/2/rec_inference.pdmodel --params_file=output_model_deepfm/2/rec_inference.pdiparams --use_gpu=True --data_dir=data/sample_data/train --reader_file=criteo_reader.py --batchsize=5 --enable_tensorRT=True

报错

E0118 19:50:24.366691 13690 helper.h:131] 4: [graphShapeAnalyzer.cpp::analyzeShapes::1872] Error Code 4: Miscellaneous (IShuffleLayer (Unnamed Layer* 10) [Shuffle]: reshape changes volume to multiple of original volume. Reshaping [13,9] to [1,1].) Traceback (most recent call last): File "/data/ymtguest/liuxinglong/ymt/PaddleRec/models/rank/deepfm/../../../tools/paddle_infer.py", line 188, in <module> main(args) File "/data/ymtguest/liuxinglong/ymt/PaddleRec/models/rank/deepfm/../../../tools/paddle_infer.py", line 126, in main predictor, pred_config = init_predictor(args) File "/data/ymtguest/liuxinglong/ymt/PaddleRec/models/rank/deepfm/../../../tools/paddle_infer.py", line 104, in init_predictor predictor = create_predictor(config) ValueError: (InvalidArgument) Errors occures in Paddle-TRT reshape2 op, try to use C++ Api config.Exp_DisableTensorRtOPs({"reshape2"}) ; or Python Api config.exp_disable_tensorrt_ops(["reshape2"]) to forbid reshape2 op into Paddle-TRT. [Hint: Expected layer->getOutput(0)->getDimensions().nbDims >= 0, but received layer->getOutput(0)->getDimensions().nbDims:-1 < 0:0.] (at ../paddle/fluid/inference/tensorrt/convert/reshape_op.cc:74)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant