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

[fm-equalize-value-py-test] failure with Conv2D_007.opt.circle #14071

Open
seanshpark opened this issue Sep 24, 2024 · 9 comments
Open

[fm-equalize-value-py-test] failure with Conv2D_007.opt.circle #14071

seanshpark opened this issue Sep 24, 2024 · 9 comments

Comments

@seanshpark
Copy link
Contributor

seanshpark commented Sep 24, 2024

[ 95%] Apply fm-equalize to /.../build/debug/compiler/fm-equalize-value-py-test/Conv2D_007.opt.circle
Error raised while running the below command
/.../build/debug/compiler/dalgona/dalgona --input_model /.../build/debug/compiler/fm-equalize-value-py-test/Conv2D_007.opt.circle --analysis /.../build/debug/compiler/fm-equalize/fmelib/DumpFMEParams.py --analysis_args /tmp/tmpfi0vci5n/Conv2D_007.after.fme_patterns.json
b'--input_data was not specified. Run with a random input.\n'
b"terminate called after throwing an instance of 'pybind11::error_already_set'\n
what(): ModuleNotFoundError: No module named 'numpy'\n\n
At:\n
.../build/debug/compiler/fm-equalize/fmelib/DumpFMEParams.py(21): \n
(241): _call_with_frames_removed\n
(883): exec_module\n
(703): _load_unlocked\n
(1006): _find_and_load_unlocked\n
(1027): _find_and_load\n
(5): \n\n"

I don't have numpy installed in my build environment.

@seanshpark
Copy link
Contributor Author

seanshpark commented Sep 24, 2024

ping @mhs4670go

I hope this test uses venv or some kind with necessary packages installed.

@seanshpark
Copy link
Contributor Author

@mhs4670go PTAL

@mhs4670go
Copy link
Contributor

Hmm.. it's weird because tensorflow 2.12.1 that is being used in venv has a dependency on numpy and fm-equalize-value-py-test is using that venv.

Could you remove venv_2_12_1 folder in overlay and re-try the build?

@seanshpark
Copy link
Contributor Author

seanshpark commented Sep 30, 2024

I've removed venv_2_12_1 in overlay folder.

  • configure and rebuild -> still got the error
    • situation: I'm building in python virtual environment cause of new python format yapf
  • build in normal (not in venv) -> got OK
    • seems venv cannot enter another venv

Strange thing is that if seems venv cannot enter another venv then I only have yapf but all other test is OK, that is, there is no onnx, Tensorflow, but test is OK.

@seanshpark
Copy link
Contributor Author

Anyway fm-equalize-value-py-test itself is running in venv so this issue can be closed.

@mhs4670go
Copy link
Contributor

Seems that it is because fm-equalize runs other python scripts. So, the solution is to change PATH or activate virtual env instead of directly call the python binary inside the venv folder.

I'll find the way to do it.

https://virtualenv.pypa.io/en/16.7.9/userguide.html

If you directly run a script or the python interpreter from the virtualenv’s bin/ directory (e.g. path/to/ENV/bin/pip or /path/to/ENV/bin/python-script.py) then sys.path will automatically be set to use the Python libraries associated with the virtualenv. But, unlike the activation scripts, the environment variables PATH and VIRTUAL_ENV will not be modified. This means that if your Python script uses e.g. subprocess to run another Python script (e.g. via a #!/usr/bin/env python shebang line) the second script may not be executed with the same Python binary as the first nor have the same libraries available to it. To avoid this happening your first script will need to modify the environment variables in the same manner as the activation scripts, before the second script is executed.

@mhs4670go mhs4670go reopened this Sep 30, 2024
@seanshpark
Copy link
Contributor Author

because fm-equalize runs other python scripts

Ah, there was something when execute in case of my environment...
OK, thanks for the explanation.

@shs-park
Copy link
Contributor

shs-park commented Oct 4, 2024

[ 95%] Apply fm-equalize to /.../build/debug/compiler/fm-equalize-value-py-test/Conv2D_007.opt.circle
Error raised while running the below command

Oh, I have the same build issue in my environment.
I'll try following the comments here.

@shs-park
Copy link
Contributor

shs-park commented Oct 4, 2024

I got this error when I did a build on a machine I hadn't used in a long time and had built on a long time ago (maybe a few months ago).

I reinstalled some apt packages listed in below document (sudo apt update too), and now it works okay.

https://github.com/Samsung/ONE/blob/master/docs/howto/how-to-build-compiler.md

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

No branches or pull requests

3 participants