MILVLG / bottom-up-attention.pytorch

A PyTorch reimplementation of bottom-up-attention models
Apache License 2.0
294 stars 76 forks source link

Question about code training in the windows environment #100

Closed Zh-MicroSat closed 1 year ago

Zh-MicroSat commented 1 year ago

Thank you for your great work, the code is perfect! I tried to train with your code on Windows10。But I have a problem. When I try:python train_net.py --mode d2 --config-file configs/d2/train-d2-r101.yaml

Traceback (most recent call last): File "train_net.py", line 20, in from bua import add_config File "D:\zh\bottom-up-attention.pytorch\bua__init.py", line 1, in from .d2 import add_attribute_config File "D:\zh\bottom-up-attention.pytorch\bua\d2__init.py", line 5, in from .modeling.roi_heads import AttributeRes5ROIHeads File "D:\zh\bottom-up-attention.pytorch\bua\d2\modeling\roi_heads.py", line 20, in from bua.caffe.modeling.box_regression import BUABox2BoxTransform File "D:\zh\bottom-up-attention.pytorch\bua\caffe__init__.py", line 2, in from .modeling.backbone import build_bua_resnet_backbone File "D:\zh\bottom-up-attention.pytorch\bua\caffe\modeling\init__.py", line 3, in from .roi_heads import BUACaffeRes5ROIHeads File "D:\zh\bottom-up-attention.pytorch\bua\caffe\modeling\roi_heads.py", line 17, in from .fast_rcnn import BUACaffeFastRCNNOutputs, BUACaffeFastRCNNOutputLayers, BUADetection2FastRCNNOutputs, BUADetectron2FastRCNNOutputLayers File "D:\zh\bottom-up-attention.pytorch\bua\caffe\modeling\fast_rcnn.py", line 15, in from .layers.nms import batched_nms File "D:\zh\bottom-up-attention.pytorch\bua\caffe\modeling\layers\nms.py", line 3, in from bua.caffe.modeling import _C ImportError: cannot import name '_C' from 'bua.caffe.modeling' (D:\zh\bottom-up-attention.pytorch\bua\caffe\modeling\init__.py)

That seems to be caffe's problem,I try to comment out the caffe reference, but another error occurs

TypeError: from_config() missing 1 required positional argument: 'input_shape'

I would like to know how to run your code smoothly under Windows and solve the above problems. Looking forward to your reply

Abhayy-Kumar commented 6 months ago

Did you get the solution?