longcw / faster_rcnn_pytorch

Faster RCNN with PyTorch
MIT License
1.71k stars 466 forks source link

the problem with running demo.py #47

Open pranerd opened 7 years ago

pranerd commented 7 years ago

~/faster_rcnn_pytorch$ python demo.py Traceback (most recent call last): File "demo.py", line 3, in import torch File "/home/user/faster_rcnn_pytorch/lfaster_rcnn/network.py", line 1, in import torch File "/home/user/anaconda2/lib/python2.7/site-packages/torch/init.py", line 53, in from torch._C import * ImportError: dlopen: cannot load any more object with static TLS

could you how to do that?

JingyunLiang commented 6 years ago

I can run demp.py successfully. But when I try to debug the code, the same error comes. Slightly different with you:

Connected to pydev debugger (build 172.3968.37)
Traceback (most recent call last):
  File "/usr/local/pycharm-community-2017.2.3/helpers/pydev/pydevd.py", line 1599, in <module>
    globals = debugger.run(setup['file'], None, None, is_module)
  File "/usr/local/pycharm-community-2017.2.3/helpers/pydev/pydevd.py", line 1026, in run
    pydev_imports.execfile(file, globals, locals)  # execute the script
  File "/usr/local/pycharm-community-2017.2.3/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile
    exec(compile(contents+"\n", file, 'exec'), glob, loc)
  File "/home/ljy/pytorch-examples-master/pytorch-faster-rcnn-master/tools/demo.py", line 20, in <module>
    from model.test import im_detect
  File "/home/ljy/pytorch-examples-master/pytorch-faster-rcnn-master/tools/../lib/model/test.py", line 19, in <module>
    from utils.timer import Timer
  File "/home/ljy/pytorch-examples-master/pytorch-faster-rcnn-master/tools/../lib/utils/timer.py", line 9, in <module>
    import torch
  File "/home/ljy/anaconda3/lib/python3.6/site-packages/torch/__init__.py", line 53, in <module>
    from torch._C import *
ImportError: dlopen: cannot load any more object with static TLS

It seems to be a problem of Pytorch, and you can follow this github issue https://github.com/pytorch/pytorch/issues/2575

JingyunLiang commented 6 years ago

Problem alleviated! You can refer to https://github.com/pytorch/pytorch/issues/2575 for solutions. Good luck! @pranerd