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

enable import onnx_tf.frontend/backend from the outside of repository #118

Merged
merged 2 commits into from
Apr 12, 2018
Merged

enable import onnx_tf.frontend/backend from the outside of repository #118

merged 2 commits into from
Apr 12, 2018

Conversation

tkng
Copy link
Contributor

@tkng tkng commented Apr 11, 2018

the wheel package of onnx-tensorflow 1.0 doesn't include .py files under frontends directory and backends directory. (Actually, directories themselves didn't exist.)

This PR fix the issue. In addition, this PR also adds some import statement in onnx_tf/__init__.py.
The latter change was needed to make it work on my environment. (Python: 3.6.3 with pyenv, OS: ubunu 16.04.)

@tjingrant
Copy link
Collaborator

Ok, I can sort of understand why the change to onnx_tf/init.py is needed. But why do you need to access the frontends and backends folder? Those folders contain versioned handlers that will be picked up by frontend.py or backend.py automatically; do you want to manage onnx version yourself? I see no advantage of doing that...

@tkng
Copy link
Contributor Author

tkng commented Apr 12, 2018

800b2ca is need to include frontends/backends files into .whl package. I describe the concrete problem in the following lines.

Currently, pip install onnx_tf installs onnx_tf 1.0, but it doesn't contain any files under onnx_tf/frontends and onnx_tf/backends. Since there's no file, onnx_tf.frontend.tensorflow_graph_to_onnx_model always fails in frontend.py line 244, importlib.import_module("onnx_tf.frontends." + frontend_ver).

As for 5f7f177, I'm not sure this commit is mandatory needed, but in my environment (Python 3.6.3), onnx_tf.frontend.tensorflow_graph_to_onnx_model didn't work without the change.

@tjingrant
Copy link
Collaborator

Hi, after doing some experiments, 800b2ca seems to be a good idea for our next release. However I cannot make sense of the error you described and you may be mixing development install with pip install. Versioned handlers as you see in frontends and backends folders are a recent development and we have not uploaded this version to pypi yet. So the problem you described cannot happen because if you install through pip, you would install an early version of onnx-tensorflow that does not require the frontends and backends directory (because at that time we released to pypi, there were indeed no frontends and backends directory and the package was correctly uploaded.

That being said, we'll take this pull request because our next release will need your modification. Thanks for your contribution!

Copy link
Collaborator

@tjingrant tjingrant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@tjingrant tjingrant merged commit 79f0cf3 into onnx:master Apr 12, 2018
@tkng
Copy link
Contributor Author

tkng commented Apr 13, 2018

Sorry for confusing, I thought that git master version and 1.0 has the same interface and internal structure. I guess that the misunderstanding caused the confusion.

In my experiment, 800b2ca is need for python setup.py bdist_wheel. Without the commit, any files under onnx_tf/frontends and onnx_tf/backends would not be included in the wheel package. Hence, as you mentioned, having the commit would be nice from the next version.

Anyway, thanks for merging! I could confirm that now my code works well with git master version.

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

Successfully merging this pull request may close these issues.

2 participants