yikang-li / FactorizableNet

Factorizable Net (Multi-GPU version): An Efficient Subgraph-based Framework for Scene Graph Generation
216 stars 38 forks source link

config file #30

Closed digbose92 closed 4 years ago

digbose92 commented 4 years ago

While running the evaluation code, which config file is being used ? Is it config.py under lib/fast_rcnn or config2.py under lib/fast_rcnn ?

digbose92 commented 4 years ago

Whenever I am running the code for evaluation : "CUDA_VISIBLE_DEVICES=0 python train_FN.py --evaluate --dataset_option=normal --path_opt options/models/VG-MSDN.yaml --pretrained_model output/trained_models/Model-VG-MSDN.h5". I am getting this error:

File "train_FN.py", line 22, in import lib.datasets as datasets File "/home/digbose92/FactorizableNet/lib/datasets/init.py", line 11, in from .visual_genome_loader import visual_genome File "/home/digbose92/FactorizableNet/lib/datasets/visual_genome_loader.py", line 20, in from lib.rpn_msr.anchor_target_layer import anchor_target_layer File "/home/digbose92/FactorizableNet/lib/rpn_msr/anchor_target_layer.py", line 21, in from lib.fast_rcnn.bbox_transform import * File "/home/digbose92/FactorizableNet/lib/fast_rcnn/bbox_transform.py", line 11, in from config import cfg ImportError: cannot import name 'cfg' . Any help ?

achehire commented 4 years ago

Hello.

You can simply fix it by replacing: from config import cfg by: from .config import cfg

The dot in front indicates you have to go up a directory to find the file you wish to import cfg from (as there is indeed a config.py file in the fast_rcnn directory).

As you said, there are two config files (config and config2). I assumed config was the correct one (though I may be wrong here).

I had to fix similar issues in about 7-8 other python files. There were also missing parenthesis in front of print functions in quite a few files. Good luck with the corrections !

digbose92 commented 4 years ago

Thanks @achehire .