Could not decode serialized type: np.ndarray. This could be because a required module is missing
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 13.4k
- Forks
- 2.4k
- Avg merge
- 5d 3h
- Merged PRs (30d)
- 2
Description
Description
I'm trying to generate a calibration cache file for post-training-quantizatio using Polygraphy.
For which I created custom input json file referring to this [https://github.com/NVIDIA/TensorRT/blob/main/tools/Polygraphy/how-to/use_custom_input_data.md]. The input shape of the model is (1,3,384,640).
The command used is below -
polygraphy convert model.onnx --int8 --load-inputs custom.json --calibration-cache custom_calib.cache -o model_trt.engine [I] Loading input data from custom.json [!] Could not decode serialized type: np.ndarray. This could be because a required module is missing.
Environment
TensorRT Version: 10.0.1.6-1
NVIDIA GPU: Tesla T4
NVIDIA Driver Version: 470.239.06
CUDA Version: 11.4
CUDNN Version:
Operating System: Ubuntu 20.04.6 LTS
Python Version (if applicable): 3.8.10
Tensorflow Version (if applicable):
PyTorch Version (if applicable):
Baremetal or Container (if so, version):
Relevant Files
Model link:
Steps To Reproduce
Commands or scripts: polygraphy convert model.onnx --int8 --load-inputs custom.json --calibration-cache custom_calib.cache -o model_trt.engine
Have you tried the latest release?:
Can this model run on other frameworks? For example run ONNX model with ONNXRuntime (polygraphy run <model.onnx> --onnxrt): Yes
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the reported polygraphy convert command with the attached custom.json, focusing on how the input data is serialized and decoded as np.ndarray. Confirm the failure and identify the needed correction so the command can load the inputs and produce the calibration cache and TensorRT engine.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100