dongnana777 / Bridging-Non-Co-occurrence

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can anyone run this code?

ChibisukeDragon opened this issue · comments

I have tried many ways to run commands python trainval_net.py, but I always failed.
I wish someone can help me to run this work.
Now I have this strange problem:

(BNCO) hy@compute01:~/BNCO/Bridging-Non-Co-occurrence$ python trainval_net.py
Traceback (most recent call last):
  File "trainval_net.py", line 33, in <module>
    from model.faster_rcnn.vgg16 import vgg16
  File "/home/hy/BNCO/Bridging-Non-Co-occurrence/lib/model/faster_rcnn/vgg16.py", line 16, in <module>
    from model.faster_rcnn.faster_rcnn import _fasterRCNN
  File "/home/hy/BNCO/Bridging-Non-Co-occurrence/lib/model/faster_rcnn/faster_rcnn.py", line 10, in <module>
    from model.rpn.rpn import _RPN
  File "/home/hy/BNCO/Bridging-Non-Co-occurrence/lib/model/rpn/rpn.py", line 8, in <module>
    from .proposal_layer import _ProposalLayer
  File "/home/hy/BNCO/Bridging-Non-Co-occurrence/lib/model/rpn/proposal_layer.py", line 21, in <module>
    from model.roi_layers import nms
  File "/home/hy/BNCO/Bridging-Non-Co-occurrence/lib/model/roi_layers/nms.py", line 3, in <module>
    from model import _C
ImportError: dynamic module does not define init function (init_C)

my pip list and environment:

torch: 1.0.0
CUDA: 10.0
gcc: version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)

(BNCO) hy@compute01:~/BNCO/Bridging-Non-Co-occurrence$ pip list
Package                       Version             Location
----------------------------- ------------------- ------------------------------------------------
backports.functools-lru-cache 1.6.4
certifi                       2020.6.20
cffi                          1.14.0
cycler                        0.10.0
Cython                        0.29.28
distro                        1.6.0
easydict                      1.9
faster-rcnn                   0.1                 /home/hy/BNCO/Bridging-Non-Co-occurrence/lib
kiwisolver                    1.1.0
matplotlib                    2.2.5
mkl-fft                       1.0.15
mkl-random                    1.1.0
mkl-service                   2.3.0
msgpack                       1.0.3
numpy                         1.16.6
olefile                       0.46
opencv-contrib-python         4.2.0.32
packaging                     20.9
Pillow                        6.2.1
pip                           19.3.1
protobuf                      3.18.0
pycocotools                   2.0.3
pycparser                     2.20
pyparsing                     2.4.7
python-dateutil               2.8.2
pytz                          2022.1
PyYAML                        5.4.1
scikit-build                  0.13.1
scipy                         1.2.3
setuptools                    44.0.0.post20200106
six                           1.16.0
subprocess32                  3.5.4
tensorboardX                  2.5
torch                         1.0.0
torchvision                   0.2.1
wheel                         0.37.1
yacs                          0.1.8

Some method I have used:

  1. pip install yacs
  2. this issue gave me a lot of help: jwyang/faster-rcnn.pytorch#503
    But it cant solve my problem. I cant from model.roi_layers import nms by using python Bridging-Non-Co-occurrence/lib/setup.py build develop
  3. I used pip install -e . in this folder: Bridging-Non-Co-occurrence/lib/, and it didnt work.
  4. add an empty file named __init__.py to these folders and so on.
Bridging-Non-Co-occurrence/lib/utils/
Bridging-Non-Co-occurrence/lib/model/nms/
Bridging-Non-Co-occurrence/lib/model/roi_layers/......

Here is my progress:

  1. git clone https://github.com/dongnana777/Bridging-Non-Co-occurrence.git
  2. cd Bridging-Non-Co-occurrence
    mkdir data
    git clone https://github.com/pdollar/coco.git
    cd coco/PythonAPI
    make
    cd ../../..
  3. conda create --name BNCO python=2.7
  4. conda activate BNCO
    pip install torch==1.0.0
    pip install torchvision==0.2.0
    pip install scikit-build
  5. pip install xxx (xxx comes from requirments.txt, except opencv-python)
  6. pip install opencv_python-3.1.0.1-cp27-cp27mu-manylinux1_x86_64.whl (offline package)
  7. add empty files named __init__.py to some folders, such as Bridging-Non-Co-occurrence/lib/model/roi_layers/
  8. cd lib
    python setup.py build develop
  9. python Bridging-Non-Co-occurrence/trainval_net.py
(BNCO2) hy@compute01:~/BNCO/Bridging-Non-Co-occurrence$ python trainval_net.py
Traceback (most recent call last):
  File "trainval_net.py", line 33, in <module>
    from model.faster_rcnn.vgg16 import vgg16
  File "/home/hy/BNCO/Bridging-Non-Co-occurrence/lib/model/faster_rcnn/vgg16.py", line 16, in <module>
    from model.faster_rcnn.faster_rcnn import _fasterRCNN
  File "/home/hy/BNCO/Bridging-Non-Co-occurrence/lib/model/faster_rcnn/faster_rcnn.py", line 10, in <module>
    from model.rpn.rpn import _RPN
  File "/home/hy/BNCO/Bridging-Non-Co-occurrence/lib/model/rpn/rpn.py", line 8, in <module>
    from .proposal_layer import _ProposalLayer
  File "/home/hy/BNCO/Bridging-Non-Co-occurrence/lib/model/rpn/proposal_layer.py", line 21, in <module>
    from model.roi_layers import nms
  File "/home/hy/BNCO/Bridging-Non-Co-occurrence/lib/model/roi_layers/nms.py", line 3, in <module>
    from model import _C
ImportError: dynamic module does not define init function (init_C)
(BNCO2) yupeng@compute01:~/BNCO/Bridging-Non-Co-occurrence$

Please have you solved this problem?

@chenfangchenf
I haven't solved the problem yet.
I think this work has some potential problems or is outdated.

@chenfangchenf I haven't solved the problem yet. I think this work has some potential problems or is outdated.

All right,have you run through other models of incremental learning about target detection?

commented

@ChibisukeDragon, I agree with you. This repo needs a potential revamp. I ran into the same error as well but alas no use.