Title: TypeError: expected CFunctionType instead of int · Issue #9 · naksyn/PythonMemoryModule · GitHub
Open Graph Title: TypeError: expected CFunctionType instead of int · Issue #9 · naksyn/PythonMemoryModule
X Title: TypeError: expected CFunctionType instead of int · Issue #9 · naksyn/PythonMemoryModule
Description: 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 C...
Open Graph Description: 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)...
X Description: 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(importordina...
Opengraph URL: https://github.com/naksyn/PythonMemoryModule/issues/9
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"TypeError: expected CFunctionType instead of int","articleBody":"while trying to load onnxruntime_pybind11_state.pyd in memory, it gives me error:\r\n```\r\nFile \"test.py\", line XXX, in build_import_table\r\n funcref.contents = GetProcAddress(hmod, cast(importordinal, LPCSTR))\r\n ^^^^^^^^^^^^^^^^\r\nTypeError: expected CFunctionType instead of int\r\n# I just copy \u0026 paste the content of __init__.py to test.py\r\n```\r\n\r\nSimple test code:\r\n```\r\nif __name__ == '__main__':\r\n import sys\r\n import importlib.util\r\n import importlib.metadata\r\n\r\n content = open('d:\\\\Python312\\\\Lib\\\\site-packages\\\\onnxruntime\\\\capi\\\\onnxruntime_pybind11_state.pyd', 'rb').read()\r\n dll = MemoryModule(data=content, debug=True)\r\n print('test for fun !')\r\n sleep(10)\r\n exit()\r\n```\r\n\r\ninstall onnxruntime module: (python 3.12.7)\r\n```\r\npip install onnxruntime-directml==1.19.2\r\n```\r\n\r\nBy the way, if test with `onnxruntime==1.19.2`, works fine\r\nFor '`onnxruntime-gpu==1.19.2`, it will just exit without printing\r\n\r\nFYI: python 3.11 version of onnxruntime-directml will have the same error","author":{"url":"https://github.com/JiaPai12138","@type":"Person","name":"JiaPai12138"},"datePublished":"2024-10-21T01:22:51.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/9/PythonMemoryModule/issues/9"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:d81a9611-d319-966a-bca8-062ca14ec1c3 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EBCA:235F04:32F805:4425D5:698F91C7 |
| html-safe-nonce | 2319c5f3ccdafe6581d0b32926621c1d1f5189be318a3e0564f55066de76b160 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQkNBOjIzNUYwNDozMkY4MDU6NDQyNUQ1OjY5OEY5MUM3IiwidmlzaXRvcl9pZCI6IjQyNzE3NDgyMDIwNTc2NjcwMTUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 671bc18cd9e3e93db5a1e278d2765f04c7a922b1fce070ff6f71d7da31d09651 |
| hovercard-subject-tag | issue:2601058131 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/naksyn/PythonMemoryModule/9/issue_layout |
| twitter:image | https://opengraph.githubassets.com/8a40428c68799994f619b6d6b0d9344cdadb7cfbdba82c44b65d65e48b49324e/naksyn/PythonMemoryModule/issues/9 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/8a40428c68799994f619b6d6b0d9344cdadb7cfbdba82c44b65d65e48b49324e/naksyn/PythonMemoryModule/issues/9 |
| og:image:alt | 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)... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | JiaPai12138 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 202633fd61f7eedb36bb7ccb403f2d581c4331c905abe8ed7a7469c697b51c27 |
| turbo-cache-control | no-preview |
| go-import | github.com/naksyn/PythonMemoryModule git https://github.com/naksyn/PythonMemoryModule.git |
| octolytics-dimension-user_id | 59816245 |
| octolytics-dimension-user_login | naksyn |
| octolytics-dimension-repository_id | 585501613 |
| octolytics-dimension-repository_nwo | naksyn/PythonMemoryModule |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 585501613 |
| octolytics-dimension-repository_network_root_nwo | naksyn/PythonMemoryModule |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | aa35d2eca6295c64e24dceaa06fde213ad1aed69 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width