huggingface / exporters

Export Hugging Face models to Core ML and TensorFlow Lite

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Problems of `Got max absolute difference of: nan`

underthestars-zhy opened this issue · comments

I was planning to convert Voicelab/vlt5-base-keywords to coreml model. Everything went well, but I got an error in the end:

Validating Core ML model...
        -[✓] Core ML model output names match reference model ({'last_hidden_state'})
        - Validating Core ML model output "last_hidden_state":
                -[✓] (1, 128, 768) matches (1, 128, 768)
                -[x] values not close enough (atol: 0.0001)
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/Users/zhuhaoyu/UTS/HeadingJsonGen/pythonProject/exporters/src/exporters/coreml/__main__.py", line 178, in <module>
    main()
  File "/Users/zhuhaoyu/UTS/HeadingJsonGen/pythonProject/exporters/src/exporters/coreml/__main__.py", line 146, in main
    convert_model(
  File "/Users/zhuhaoyu/UTS/HeadingJsonGen/pythonProject/exporters/src/exporters/coreml/__main__.py", line 70, in convert_model
    validate_model_outputs(coreml_config, preprocessor, model, mlmodel, args.atol)
  File "/Users/zhuhaoyu/UTS/HeadingJsonGen/pythonProject/exporters/src/exporters/coreml/validate.py", line 220, in validate_model_outputs
    raise ValueError(
ValueError: Output values do not match between reference model and Core ML exported model: Got max absolute difference of: nan