krumo / Domain-Adaptive-Faster-RCNN-PyTorch

Domain Adaptive Faster R-CNN in PyTorch
MIT License
305 stars 68 forks source link

cannot import name '_C' from 'maskrcnn_benchmark' #31

Closed Azann closed 2 years ago

Azann commented 2 years ago

ImportError: cannot import name '_C' from 'maskrcnn_benchmark' (/home/crx/zhanzan/Domain-Adaptive-Faster-RCNN-PyTorch_5/maskrcnn_benchmark/init.py)

I can run train_net.py in terminal successfully. But I can't run this in pycharm.

Azann commented 2 years ago

I found out where is my problem. The reason is that Before I run the code, I don't complile the environment I need successfully.

chengxy1998 commented 2 years ago

File "/home/data/Lm/anaconda3/envs/maskrcnn_benchmark/lib/python3.7/site-packages/yacs/config.py", line 491, in _merge_a_into_b raise KeyError("Non-existent config key: {}".format(full_key)) KeyError: 'Non-existent config key: MODEL.DOMAIN_ADAPTATION_ON'

Who can tell me how to solve this problem, I will be very grateful

krumo commented 2 years ago

File "/home/data/Lm/anaconda3/envs/maskrcnn_benchmark/lib/python3.7/site-packages/yacs/config.py", line 491, in _merge_a_into_b raise KeyError("Non-existent config key: {}".format(full_key)) KeyError: 'Non-existent config key: MODEL.DOMAIN_ADAPTATION_ON'

Who can tell me how to solve this problem, I will be very grateful

This error generally means that you don't compile this project successfully. Please follow the instructions in INSTALL.md to compile this project first.

leoliu37 commented 2 years ago

I solve the problem. Actually, you need to compile it in the folder './Domain-Adaptive-Faster-RCNN-Pytorch'. Good wishes to you.