Hi,
so an update, my issue was related to keras2onnx,
I found (a hack) that if you remove the version check in
%env_location%\Lib\site-packages\keras2onnx\proto\__init__.py
remove the call to
#_check_onnx_version()
This seems to fix the issue for me.


Alon

On Mon, 6 Jul 2020 at 10:39, alon shoa <[email protected]> wrote:

> Hi,
> I have the same problem,
> I'm using onnx 1.7.
> it creates the exe file, but it fails on runtime with the same exception.
> I'm using keras2onnx to create a onnx model.
> tried adding it as hidden-import or adding it as additional hook folder,
> but I'm new to pyinstaller, so maybe the hook part is an incorrect way
>
> were you able to solve your problem?
>
> when you say  It’s running quite happily on my machine. what onnx did you
> use? how did you try to run it?
>
> thanks,
> Alon
>
> On Saturday, July 4, 2020 at 8:48:31 PM UTC+3, bwoodsend wrote:
>>
>> Hi,
>>
>> Is there more of a traceback you can provide besides the 
>> pkg_resources.DistributionNotFound:
>> The "onnx" distribution was not found and is required by the application
>> line? I’ve seen errors like that caused when packages use pkg_resources
>> to get there own version to set as a __version__ attribute but I can’t
>> see anything like that in ONNX’s or keras’s source code. It’s running quite
>> happily on my machine.
>>
>> Brénainn
>> ​
>> On Friday, July 3, 2020 at 6:46:43 PM UTC+1 [email protected] wrote:
>>
>>> Hi there,
>>>
>>> I am currently trying to train a Deep learning module and amd importing
>>> and exporting using ONNX and keras converters. These libraries are seldom
>>> used with Pyinstaller and result in the following error when i run the .exe
>>> file:
>>>
>>> pkg_resources.DistributionNotFound: The "onnx" distribution was not
>>> found and is required by the application
>>>
>>> I have already tried including the onnx dependency within the .spec file
>>> upon building the executable here, but I figured that I am probably doing
>>> something incorrectly in the analysis section:
>>> .....
>>> datas=[('GrayscaleClassifierFast_3.onnx', '.'),
>>> (os.path.join(os.path.dirname(importlib.import_module('tensorflow').__file__),
>>> "lite/experimental/microfrontend/python/ops/_audio_microfrontend_op.so"),
>>> "tensorflow/lite/experimental/microfrontend/python/ops/")],
>>> hiddenimports=['pkg_resources.py2_warn', 'tensorflow'],  .....
>>>
>>> Has anyone else experienced the pkg.resource error? How was this dealt
>>> with? Thanks!
>>>
>>> Allen
>>>
>>
> On Saturday, July 4, 2020 at 8:48:31 PM UTC+3, bwoodsend wrote:
>>
>> Hi,
>>
>> Is there more of a traceback you can provide besides the 
>> pkg_resources.DistributionNotFound:
>> The "onnx" distribution was not found and is required by the application
>> line? I’ve seen errors like that caused when packages use pkg_resources
>> to get there own version to set as a __version__ attribute but I can’t
>> see anything like that in ONNX’s or keras’s source code. It’s running quite
>> happily on my machine.
>>
>> Brénainn
>> ​
>> On Friday, July 3, 2020 at 6:46:43 PM UTC+1 [email protected] wrote:
>>
>>> Hi there,
>>>
>>> I am currently trying to train a Deep learning module and amd importing
>>> and exporting using ONNX and keras converters. These libraries are seldom
>>> used with Pyinstaller and result in the following error when i run the .exe
>>> file:
>>>
>>> pkg_resources.DistributionNotFound: The "onnx" distribution was not
>>> found and is required by the application
>>>
>>> I have already tried including the onnx dependency within the .spec file
>>> upon building the executable here, but I figured that I am probably doing
>>> something incorrectly in the analysis section:
>>> .....
>>> datas=[('GrayscaleClassifierFast_3.onnx', '.'),
>>> (os.path.join(os.path.dirname(importlib.import_module('tensorflow').__file__),
>>> "lite/experimental/microfrontend/python/ops/_audio_microfrontend_op.so"),
>>> "tensorflow/lite/experimental/microfrontend/python/ops/")],
>>> hiddenimports=['pkg_resources.py2_warn', 'tensorflow'],  .....
>>>
>>> Has anyone else experienced the pkg.resource error? How was this dealt
>>> with? Thanks!
>>>
>>> Allen
>>>
>>
> On Saturday, July 4, 2020 at 8:48:31 PM UTC+3, bwoodsend wrote:
>>
>> Hi,
>>
>> Is there more of a traceback you can provide besides the 
>> pkg_resources.DistributionNotFound:
>> The "onnx" distribution was not found and is required by the application
>> line? I’ve seen errors like that caused when packages use pkg_resources
>> to get there own version to set as a __version__ attribute but I can’t
>> see anything like that in ONNX’s or keras’s source code. It’s running quite
>> happily on my machine.
>>
>> Brénainn
>> ​
>> On Friday, July 3, 2020 at 6:46:43 PM UTC+1 [email protected] wrote:
>>
>>> Hi there,
>>>
>>> I am currently trying to train a Deep learning module and amd importing
>>> and exporting using ONNX and keras converters. These libraries are seldom
>>> used with Pyinstaller and result in the following error when i run the .exe
>>> file:
>>>
>>> pkg_resources.DistributionNotFound: The "onnx" distribution was not
>>> found and is required by the application
>>>
>>> I have already tried including the onnx dependency within the .spec file
>>> upon building the executable here, but I figured that I am probably doing
>>> something incorrectly in the analysis section:
>>> .....
>>> datas=[('GrayscaleClassifierFast_3.onnx', '.'),
>>> (os.path.join(os.path.dirname(importlib.import_module('tensorflow').__file__),
>>> "lite/experimental/microfrontend/python/ops/_audio_microfrontend_op.so"),
>>> "tensorflow/lite/experimental/microfrontend/python/ops/")],
>>> hiddenimports=['pkg_resources.py2_warn', 'tensorflow'],  .....
>>>
>>> Has anyone else experienced the pkg.resource error? How was this dealt
>>> with? Thanks!
>>>
>>> Allen
>>>
>>
> On Saturday, July 4, 2020 at 8:48:31 PM UTC+3, bwoodsend wrote:
>>
>> Hi,
>>
>> Is there more of a traceback you can provide besides the 
>> pkg_resources.DistributionNotFound:
>> The "onnx" distribution was not found and is required by the application
>> line? I’ve seen errors like that caused when packages use pkg_resources
>> to get there own version to set as a __version__ attribute but I can’t
>> see anything like that in ONNX’s or keras’s source code. It’s running quite
>> happily on my machine.
>>
>> Brénainn
>> ​
>> On Friday, July 3, 2020 at 6:46:43 PM UTC+1 [email protected] wrote:
>>
>>> Hi there,
>>>
>>> I am currently trying to train a Deep learning module and amd importing
>>> and exporting using ONNX and keras converters. These libraries are seldom
>>> used with Pyinstaller and result in the following error when i run the .exe
>>> file:
>>>
>>> pkg_resources.DistributionNotFound: The "onnx" distribution was not
>>> found and is required by the application
>>>
>>> I have already tried including the onnx dependency within the .spec file
>>> upon building the executable here, but I figured that I am probably doing
>>> something incorrectly in the analysis section:
>>> .....
>>> datas=[('GrayscaleClassifierFast_3.onnx', '.'),
>>> (os.path.join(os.path.dirname(importlib.import_module('tensorflow').__file__),
>>> "lite/experimental/microfrontend/python/ops/_audio_microfrontend_op.so"),
>>> "tensorflow/lite/experimental/microfrontend/python/ops/")],
>>> hiddenimports=['pkg_resources.py2_warn', 'tensorflow'],  .....
>>>
>>> Has anyone else experienced the pkg.resource error? How was this dealt
>>> with? Thanks!
>>>
>>> Allen
>>>
>>
> On Saturday, July 4, 2020 at 8:48:31 PM UTC+3, bwoodsend wrote:
>>
>> Hi,
>>
>> Is there more of a traceback you can provide besides the 
>> pkg_resources.DistributionNotFound:
>> The "onnx" distribution was not found and is required by the application
>> line? I’ve seen errors like that caused when packages use pkg_resources
>> to get there own version to set as a __version__ attribute but I can’t
>> see anything like that in ONNX’s or keras’s source code. It’s running quite
>> happily on my machine.
>>
>> Brénainn
>> ​
>> On Friday, July 3, 2020 at 6:46:43 PM UTC+1 [email protected] wrote:
>>
>>> Hi there,
>>>
>>> I am currently trying to train a Deep learning module and amd importing
>>> and exporting using ONNX and keras converters. These libraries are seldom
>>> used with Pyinstaller and result in the following error when i run the .exe
>>> file:
>>>
>>> pkg_resources.DistributionNotFound: The "onnx" distribution was not
>>> found and is required by the application
>>>
>>> I have already tried including the onnx dependency within the .spec file
>>> upon building the executable here, but I figured that I am probably doing
>>> something incorrectly in the analysis section:
>>> .....
>>> datas=[('GrayscaleClassifierFast_3.onnx', '.'),
>>> (os.path.join(os.path.dirname(importlib.import_module('tensorflow').__file__),
>>> "lite/experimental/microfrontend/python/ops/_audio_microfrontend_op.so"),
>>> "tensorflow/lite/experimental/microfrontend/python/ops/")],
>>> hiddenimports=['pkg_resources.py2_warn', 'tensorflow'],  .....
>>>
>>> Has anyone else experienced the pkg.resource error? How was this dealt
>>> with? Thanks!
>>>
>>> Allen
>>>
>> --
> You received this message because you are subscribed to the Google Groups
> "PyInstaller" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pyinstaller/78c8dc80-152a-47b5-b132-ddd3cd1f2a17o%40googlegroups.com
> <https://groups.google.com/d/msgid/pyinstaller/78c8dc80-152a-47b5-b132-ddd3cd1f2a17o%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyinstaller/CAFOAEwErXs%3Dr0V0ba-hqNNyZb_ycZndqGJNo_EbkMjn1JNkzSw%40mail.gmail.com.

Reply via email to