/home/jiang/anaconda3/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88
return f(args, *kwds)
/home/jiang/anaconda3/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88
return f(args, *kwds)
Traceback (most recent call last):
File "trainval_net.py", line 33, in
from model.faster_rcnn.vgg16 import vgg16
File "/home/jiang/faster-rcnn.pytorch/lib/model/faster_rcnn/vgg16.py", line 16, in
from model.faster_rcnn.faster_rcnn import _fasterRCNN
File "/home/jiang/faster-rcnn.pytorch/lib/model/faster_rcnn/faster_rcnn.py", line 10, in
from model.rpn.rpn import _RPN
File "/home/jiang/faster-rcnn.pytorch/lib/model/rpn/rpn.py", line 8, in
from .proposal_layer import _ProposalLayer
File "/home/jiang/faster-rcnn.pytorch/lib/model/rpn/proposal_layer.py", line 21, in
from model.roi_layers import nms
File "/home/jiang/faster-rcnn.pytorch/lib/model/roi_layers/__init__.py", line 3, in
from .nms import nms
File "/home/jiang/faster-rcnn.pytorch/lib/model/roi_layers/nms.py", line 3, in
from model import _C
ImportError: cannot import name '_C'
When I run pytorch1.0 branch,I have the same problem with you. But I can find /model/_C.cpython-36m-x86_64-linux-gnu.so
Then how did you solve it?
I have the same error when I run the demo in pytorch 1.0 branch, and solution?
I solved it.
1) install pytorch 1.0.0 .
I used 1.0.1 before,then got error :
from model import _C
ImportError: /mypath/to...... /model/_C.cpython-36m-x86_64-linux-gnu.so: undefined symbol: _ZN3c105ErrorC1ENS_14SourceLocationERKSs
2)update GCC by :conda install -c psi4 gcc-5
I received warning when using GCC4.8: Your compiler (g++ 4.8.5) may be ABI-incompatible with PyTorch! Please use a compiler that is ABI-compatible with GCC 4.9 and above. 。。。。
see: https://gist.github.com/goldsborough/d466f43e8ffc948ff92de7486c5216d6
Thanks @DiaoYuxian
downgrading pytorch to 1.0.0
rm -rf lib/build/
python setup.py build develop
solved the problem too.
wonder if its a bug in nightly pytorch..
When I run pytorch1.0 branch,I have the same problem with you. But I can find /model/_C.cpython-36m-x86_64-linux-gnu.so
Then how did you solve it?
Why can't I find this /_C.cpython-36m-x86_64-linux-gnu.so under /model?
This is because of pytorch version incompatibility ,
pip install torch==1.3.0
These Worked for me .
Thanks @DiaoYuxian
downgrading pytorch to 1.0.0
rm -rf lib/build/ python setup.py build developsolved the problem too.
wonder if its a bug in nightly pytorch..
It seems version incompability is the main reason. Just remove the build and build it again.
I have tried many times, from torch 1.0.0 to torch 1.3.0. I am still suffering the problem.... @DiaoYuxian I also follow your instruction. But it does not work. Any idea? Thanks
Do you solve the problem? @wtliao I met the same problem and tried many times too....
Thanks @DiaoYuxian
downgrading pytorch to 1.0.0
rm -rf lib/build/ python setup.py build developsolved the problem too.
wonder if its a bug in nightly pytorch..
My compile env:
torch=1.3.1
torchvision=0.4.2
python=3.6
OS = linux
When I try to run trainval_net.py, I have the similar problem:
undefined symbol: _ZN2at19UndefinedTensorImpl10_singletonE
after remove the lib/build/
and run :
python setup.py build develop
These worked.
Thanks!
thans to before all. I have already solved this problem.
Cant find _C ???
I have spent 5 days to solve the same problem, which comes from stereo-rcnn,not this.
when I want to build and run nms.py. it shows:
undefined symbol: _ZN2at19UndefinedTensorImpl10_singletonE
My compile env:
torch=1.0.0
torchvision=0.2.2
cuda =9
python=3.6
gcc 5.4
OS = linux
it should work,but i fail
finally, I find the soultion in pytorch.org. I must import torch.
I success
In a word. we should keep torch,torchvision,cuda ,python,and gcc compatible.what's more, import torch.hope it can help you.
Install pytorch1.0.0, and compile the cuda dependencies using following simple commands:
cd lib
python setup.py build develop
it works.
You can run train trainval_net.py at torch==1.0.0 torchvision==0.2.0, but run test_net.py will get ImportError: /root/code/faster-rcnn.pytorch/lib/model/_C.cpython-35m-x86_64-linux-gnu.so: undefined symbol: _ZN2at19UndefinedTensorImpl10_singletonE.
It's because the version of pythrch. I install 1.3.0 by pip install torch==1.3.0+cu100 torchvision==0.4.1+cu100 -f https://download.pytorch.org/whl/torch_stable.html
Remember pythrch need match cuda,my cuda version is 10.
pip install torch==1.3.0+cu100 torchvision==0.4.1+cu100 -f https://download.pytorch.org/whl/torch_stable.html
cd lib
rm -rf build
python setup.py build develop
Thanks @DiaoYuxian
downgrading pytorch to 1.0.0
rm -rf lib/build/ python setup.py build developsolved the problem too.
wonder if its a bug in nightly pytorch..
It worked on macOS.
But it's more accurate like this:
cd lib/
rm -rf build
python setup.py build develop
cd ../
python demo.py
then got:
Installed /Users/user_name/dir/faster-rcnn.pytorch/lib
Processing dependencies for faster-rcnn==0.1
Finished processing dependencies for faster-rcnn==0.1
Most helpful comment
Thanks @DiaoYuxian
downgrading pytorch to 1.0.0
solved the problem too.
wonder if its a bug in nightly pytorch..