loolzaaa / faster-rcnn-pytorch

A PyTorch implementation of Faster R-CNN
MIT License
17 stars 5 forks source link

can't find config file #1

Closed ryankimky closed 4 years ago

ryankimky commented 4 years ago

For run.py, i can't find config file.

Traceback (most recent call last): File "run.py", line 7, in from config import cfg ImportError: No module named 'config'

plz upload config file. thx

loolzaaa commented 4 years ago

Config file already uploaded, this is it

Which version of python do you use? I don't have an __init__.py files in modules because it is not necessary for Python 3.3+

Also, there is a next code in run.py script:

lib_path = os.path.join(os.path.dirname(__file__), 'lib')
if lib_path not in sys.path:
    sys.path.insert(0, lib_path)

This code add ./lib folder to sys.path, where python search modules.

So, you can add print(sys.path) after code i show above and check, that ./lib folder of library was added to sys.path variable.

loolzaaa commented 4 years ago

Are you check availability of ./lib folder in sys.path list after start run script?

ryankimky commented 4 years ago

i am using python 3.5.2. i still checking the your run.py script.

loolzaaa commented 4 years ago

Oh, this is my mistake! You try to import config module before add its path to sys.

Try to change in run.py: BEFORE:

from config import cfg`
...
from utils.net_utils import parse_additional_params

AFTER:

from lib.config import cfg
...
from lib.utils.net_utils import parse_additional_params
ryankimky commented 4 years ago

thx, i will try to run it again.

loolzaaa commented 4 years ago

I am update library with https://github.com/loolzaaa/faster-rcnn-pytorch/commit/4231d939eca754329d3912fcabb7ded62be762d1, just pull it.

Feel free to reopen issue if problem did not solved.

ryankimky commented 4 years ago

I am update library with 4231d93, just pull it.

Feel free to reopen issue if problem did not solved.

thx to fix it.

but, i already add 'lib' to all import~ :-)