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

ValueError: Validation Failed #297

Open
RhinoInani opened this issue Jul 11, 2024 · 0 comments
Open

ValueError: Validation Failed #297

RhinoInani opened this issue Jul 11, 2024 · 0 comments

Comments

@RhinoInani
Copy link

Hello,
I am running into an issue where the auto converter keeps failing due to validation in the model. I understand the basics of why this is occurring but am not sure about the in-depth detail. Could someone please provide some more details about how I can fix this issue and/or why it could be occurring.

CODE:

feed_dict_list = []

for batch in tqdm(val_loader_onnx, desc="Processing Batches"):
    inputs, labels = batch
    inputs = inputs.numpy()
    labels = labels.numpy()

    feed_dict = {
        'input': inputs,
    }
    feed_dict_list.append(feed_dict)


model_fp16 = auto_convert_mixed_precision(model, feed_dict, rtol=0.01, atol=0.001, keep_io_types=True)

ERROR:

Traceback (most recent call last):
  File "onnx_converter.py", line 73, in <module>
    model_fp16 = auto_convert_mixed_precision(model, feed_dict, rtol=0.01, atol=0.001)
  File "****/miniconda3/envs/internimage/lib/python3.7/site-packages/onnxconverter_common/auto_mixed_precision.py", line 81, in auto_convert_mixed_precision
    raise ValueError("validation failed for model with all nodes in node_block_list")
ValueError: validation failed for model with all nodes in node_block_list

PS:
Another problem I was running into with the autoconverter was when I was running feed_dict_list in the line of code above to run the auto_convert_mixed_precision it doesn't run fully and doesn't generate a new onnx file and just quits with no warning or error. This occurs when keep_io_types is True or False. Is there any reason for this? Could someone please explain this to me.

This is an example of the end of the output from when I use feed_dict_list instead of feed_dict:

[-1.0549891 , -1.1072767 , -1.1421349 , ...,  0.2870589 ,
           0.2870589 ,  0.32191727]]]], dtype=float32)}], None

Thanks,
Rhino

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