Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

TypeError: expected CFunctionType instead of int #9

Copy link
Copy link
@JiaPai12138

Description

@JiaPai12138
Issue body actions

while trying to load onnxruntime_pybind11_state.pyd in memory, it gives me error:

File "test.py", line XXX, in build_import_table
    funcref.contents = GetProcAddress(hmod, cast(importordinal, LPCSTR))
    ^^^^^^^^^^^^^^^^
TypeError: expected CFunctionType instead of int
# I just copy & paste the content of __init__.py to test.py

Simple test code:

if __name__ == '__main__':
    import sys
    import importlib.util
    import importlib.metadata

    content = open('d:\\Python312\\Lib\\site-packages\\onnxruntime\\capi\\onnxruntime_pybind11_state.pyd', 'rb').read()
    dll = MemoryModule(data=content, debug=True)
    print('test for fun !')
    sleep(10)
    exit()

install onnxruntime module: (python 3.12.7)

pip install onnxruntime-directml==1.19.2

By the way, if test with onnxruntime==1.19.2, works fine
For 'onnxruntime-gpu==1.19.2, it will just exit without printing

FYI: python 3.11 version of onnxruntime-directml will have the same error

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.