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

No module named 'binop' #1

Open
aoreskovic opened this issue Jun 12, 2018 · 4 comments
Open

No module named 'binop' #1

aoreskovic opened this issue Jun 12, 2018 · 4 comments

Comments

@aoreskovic
Copy link

No matter what i try, I can run the training. I have tried compiling binop, and it compiles fine, but running doenst work:

on Ubuntu LTS 18.04: (Python 3.6, Pytorch 4.0, no GPU)

python3 main.py --arch Bin_LeNet
Traceback (most recent call last):
  File "main.py", line 18, in <module>
    import models as models
  File "/home/aoreskovic/GitHub/Pytorch-XNOR-Net-master/MNIST/models/__init__.py", line 2, in <module>
    from .Bin_LeNet import Bin_LeNet_test
  File "/home/aoreskovic/GitHub/Pytorch-XNOR-Net-master/MNIST/models/Bin_LeNet.py", line 6, in <module>
    from util import BinLinear
  File "../util/__init__.py", line 1, in <module>
    from .util import *
  File "../util/util.py", line 1, in <module>
    import binop
ModuleNotFoundError: No module named 'binop'

on Win10: (Python 3.6, Pytorch 4.0, no GPU)

python main.py --arch Bin_LeNet
Traceback (most recent call last):
  File "main.py", line 18, in <module>
    import models as models
  File "H:\Dropbox\NeuralXNOR\Pytorch-XNOR-Net\MNIST\models\__init__.py", line 2, in <module>
    from .Bin_LeNet import Bin_LeNet_test
  File "H:\Dropbox\NeuralXNOR\Pytorch-XNOR-Net\MNIST\models\Bin_LeNet.py", line 6, in <module>
    from util import BinLinear
  File "..\util\__init__.py", line 1, in <module>
    from .util import *
  File "..\util\util.py", line 1, in <module>
    import binop
  File "..\binop\__init__.py", line 3, in <module>
    from ._binop import lib as _lib, ffi as _ffi
ModuleNotFoundError: No module named 'binop._binop'

It looks like there should be some module named binop.py that acts like a wrapper for _binop, but that isnt generated?

@cooooorn
Copy link
Owner

cooooorn commented Jul 2, 2018

try ./make.sh , and run the training.

@cooooorn
Copy link
Owner

cooooorn commented Jul 2, 2018

and if you use Pytorch 0.4.0, it will be very slow, because the usage of .data.
for more details, you can read PyTorch 0.4.0 release notes.

@weitianli
Copy link

weitianli commented Sep 24, 2018

When I run the training, I also meet the problem above. I try ./make.sh. But I such a problem.

on Ubuntu 16.04, (Python 3.5, Pytorch 0.4.1, gcc 5.4, CUDA 9.0)

_binop.c:28:20: fatal error: Python.h: No such file or directory
compilation terminated.
Traceback (most recent call last):
  File "/usr/lib/python3.5/distutils/unixccompiler.py", line 118, in _compile
    extra_postargs)
  File "/usr/lib/python3.5/distutils/ccompiler.py", line 909, in spawn
    spawn(cmd, dry_run=self.dry_run)
  File "/usr/lib/python3.5/distutils/spawn.py", line 36, in spawn
    _spawn_posix(cmd, search_path, dry_run=dry_run)
  File "/usr/lib/python3.5/distutils/spawn.py", line 159, in _spawn_posix
    % (cmd, exit_status))
distutils.errors.DistutilsExecError: command 'x86_64-linux-gnu-gcc' failed with exit status 1

@weitianli
Copy link

weitianli commented Sep 25, 2018

I solved the problem that I used Pytorch 0.4.0 version.
But I met a new problem.

Traceback (most recent call last):
  File "main.py", line 19, in <module>
    import binop
  File "../binop/__init__.py", line 3, in <module>
    from ._binop import lib as _lib, ffi as _ffi
ImportError: dynamic module does not define module export function (PyInit__binop)

How to figure it out?

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