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

ModuleNotFoundError: No module named '_dnnc' #135

Open
mohaimenz opened this issue Oct 24, 2020 · 9 comments
Open

ModuleNotFoundError: No module named '_dnnc' #135

mohaimenz opened this issue Oct 24, 2020 · 9 comments

Comments

@mohaimenz
Copy link

mohaimenz commented Oct 24, 2020

Hi,
After installing deepC, I am trying to test if it is working. I see the following error. Any suggestion regarding this error?
Environment: Mac OS

(base) MU00158281X:~ mmoh0027$ python -c "import deepC.dnnc as dc; print(dc.arange(5));"
Traceback (most recent call last):
  File "/Users/mmoh0027/opt/anaconda3/lib/python3.7/site-packages/deepC/dnnc.py", line 14, in swig_import_helper
    return importlib.import_module(mname)
  File "/Users/mmoh0027/opt/anaconda3/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 670, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 583, in module_from_spec
  File "<frozen importlib._bootstrap_external>", line 1043, in create_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
ImportError: dlopen(/Users/mmoh0027/opt/anaconda3/lib/python3.7/site-packages/deepC/_dnnc.so, 2): no suitable image found.  Did find:
	/Users/mmoh0027/opt/anaconda3/lib/python3.7/site-packages/deepC/_dnnc.so: unknown file type, first eight bytes: 0x7F 0x45 0x4C 0x46 0x02 0x01 0x01 0x00
	/Users/mmoh0027/opt/anaconda3/lib/python3.7/site-packages/deepC/_dnnc.so: unknown file type, first eight bytes: 0x7F 0x45 0x4C 0x46 0x02 0x01 0x01 0x00

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/Users/mmoh0027/opt/anaconda3/lib/python3.7/site-packages/deepC/dnnc.py", line 17, in <module>
    _dnnc = swig_import_helper()
  File "/Users/mmoh0027/opt/anaconda3/lib/python3.7/site-packages/deepC/dnnc.py", line 16, in swig_import_helper
    return importlib.import_module('_dnnc')
  File "/Users/mmoh0027/opt/anaconda3/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
ModuleNotFoundError: No module named '_dnnc'
@srohit0
Copy link
Member

srohit0 commented Oct 24, 2020

It should not occur, if you used

python3 setup.py install

Workaround 1: run sudo python3 setup.py install

Workaround 1: set environmental variable PYTHONPATH, e.g. export PYTHONPATH=<deepC-root-dir>/

@mohaimenz
Copy link
Author

mohaimenz commented Oct 25, 2020

@srohit0
Hi Rohit,
Thanks for your suggestion.
I have used pip install deepC that all your tutorials and videos suggested. It always said 'deepC.dnnc is not found'.
I manually checked the installation and it was not there.
Then cloned the git repo and I used all your suggested options but no luck, same error.
I have also tried the suggested way provided at the top of the setup.py file
how to run this script: python setup.py bdist_wheel
how to test install: python -m pip install ~/dnnc/master/deepC/dist/dnnc-0.1-py3-none-any.whl --root pip_install_test

So, I haven't been able to use deepC anyway.
Am I missing something?

@srohit0
Copy link
Member

srohit0 commented Oct 25, 2020

Few developers have used MAC in the past successfully.

You can use cainvas.ai-tech.systems to avoid installation.

We'd be glad to help out, if you're open.

@AnanyaPadmadharan
Copy link

Hi, I have developed a tensorflow model and convertred it to onnx. Now I need to port it to micro controller. I need to convert it to c. I am using windows 10.
I tried these codes and I am also getting the "ModuleNotFoundError: No module named '_dnnc'. Can you please help me.

@srohit0
Copy link
Member

srohit0 commented May 28, 2021

Sure, we'd be happy to help if you can share your screen to resolve the issue.

Alternatively, you can use cainvas.ai-tech.systems to avoid installation and the issue altogether.

@AnanyaPadmadharan
Copy link

C:\Users\Anaconda3\Lib\site-packages\deepC\scripts>python -m onnx2cpp tf_to_onnx_model.onnx
Traceback (most recent call last):
File "C:\Users\Anaconda3\lib\site-packages\deepC\dnnc.py", line 14, in swig_import_helper
return importlib.import_module(mname)
File "C:\Users\Anaconda3\lib\importlib_init_.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1014, in _gcd_import
File "", line 991, in _find_and_load
File "", line 973, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'deepC._dnnc'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\Anaconda3\lib\runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\40010033\Anaconda3\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:\Users\Anaconda3\Lib\site-packages\deepC\scripts\onnx2cpp.py", line 31, in
import deepC.dnnc as dnnc
File "C:\Users\Anaconda3\lib\site-packages\deepC\dnnc.py", line 17, in
_dnnc = swig_import_helper()
File "C:\Users\Anaconda3\lib\site-packages\deepC\dnnc.py", line 16, in swig_import_helper
return importlib.import_module('dnnc')
File "C:\Users\Anaconda3\lib\importlib_init
.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ModuleNotFoundError: No module named '_dnnc'

@srohit0
Copy link
Member

srohit0 commented May 31, 2021

Thanks. Please reach out to hi @ ai-techayatems .c0m for further installation support.

@AnanyaPadmadharan
Copy link

AnanyaPadmadharan commented Jun 1, 2021 via email

@srohit0
Copy link
Member

srohit0 commented Jun 3, 2021

You're one of the few reporting this. Unless we see the issue in action, there are no steps we can recommend.

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