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

RuntimeError: Op Execution Error: /Slice(Type: Slice, Num of Input: 5, Num of Output: 1) #566

Open
yehu3d opened this issue Jun 18, 2024 · 0 comments

Comments

@yehu3d
Copy link

yehu3d commented Jun 18, 2024

我在量化一个多输入模型:

dataset = CaliData(datapath, bs)
dataloader = data.DataLoader(dataset, batch_size=bs)
with ENABLE_CUDA_KERNEL():
    quantized = quantize_torch_model(
        model=model, calib_dataloader=dataloader,
        calib_steps=32, input_shape=None,inputs = next(iter(dataloader)),
        collate_fn=collate_fn, platform=PLATFORM, setting=QS,
        onnx_export_file='output.onnx', device=DEVICE, verbose=0)

报错如下:

[Warning] Unexpected input value of operation /Slice, recieving "None" at its input 0
Traceback (most recent call last):

  File D:\anaconda3\Lib\site-packages\ppq-0.6.6-py3.11.egg\ppq\executor\torch.py:536 in __forward
    outputs = operation_forward_func(operation, inputs, self._executing_context)

  File D:\anaconda3\Lib\site-packages\ppq-0.6.6-py3.11.egg\ppq\executor\op\torch\default.py:1404 in Slice_forward
    if pos_axes_slices: data = data[pos_axes_slices]

TypeError: 'NoneType' object is not subscriptable


The above exception was the direct cause of the following exception:

Traceback (most recent call last):

  File D:\anaconda3\Lib\site-packages\spyder_kernels\py3compat.py:356 in compat_exec
    exec(code, globals, locals)

  File e:\int8\int8test.py:58
    quantized = quantize_torch_model(

  File D:\anaconda3\Lib\site-packages\ppq-0.6.6-py3.11.egg\ppq\core\defs.py:54 in _wrapper
    return func(*args, **kwargs)

  File D:\anaconda3\Lib\site-packages\ppq-0.6.6-py3.11.egg\ppq\api\interface.py:343 in quantize_torch_model
    return quantize_onnx_model(onnx_import_file=onnx_export_file,

  File D:\anaconda3\Lib\site-packages\ppq-0.6.6-py3.11.egg\ppq\core\defs.py:54 in _wrapper
    return func(*args, **kwargs)

  File D:\anaconda3\Lib\site-packages\ppq-0.6.6-py3.11.egg\ppq\api\interface.py:263 in quantize_onnx_model
    quantizer.quantize(

  File D:\anaconda3\Lib\site-packages\ppq-0.6.6-py3.11.egg\ppq\core\defs.py:54 in _wrapper
    return func(*args, **kwargs)

  File D:\anaconda3\Lib\site-packages\ppq-0.6.6-py3.11.egg\ppq\quantization\quantizer\base.py:52 in quantize
    executor.tracing_operation_meta(inputs=inputs)

  File D:\anaconda3\Lib\site-packages\torch\utils\_contextlib.py:115 in decorate_context
    return func(*args, **kwargs)

  File D:\anaconda3\Lib\site-packages\ppq-0.6.6-py3.11.egg\ppq\core\defs.py:54 in _wrapper
    return func(*args, **kwargs)

  File D:\anaconda3\Lib\site-packages\ppq-0.6.6-py3.11.egg\ppq\executor\torch.py:598 in tracing_operation_meta
    self.__forward(

  File D:\anaconda3\Lib\site-packages\ppq-0.6.6-py3.11.egg\ppq\executor\torch.py:563 in __forward
    raise RuntimeError(f'Op Execution Error: {str(operation)}') from _

RuntimeError: Op Execution Error: /Slice(Type: Slice, Num of Input: 5, Num of Output: 1)

不知道哪里错了,求大佬指点迷津,本人菜鸡初学者一枚

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