OverLoCK icon indicating copy to clipboard operation
OverLoCK copied to clipboard

AttributeError: 'int' object has no attribute 'type'

Open WuBai2005 opened this issue 2 months ago • 4 comments

Glad to able to ask you some questions. I have only two gpus and use "NUM_GPUS=2" "CONFIG=configs/maskrcnn_overlock/mask_rcnn_overlock_t_in1k_fpn_1x_coco.py" "bash scripts/dist_train.sh $CONFIG $NUM_GPUS" to do the detection, then it has the error: "AttributeError: 'int' object has no attribute 'type'", what should I do next to train?

WuBai2005 avatar Nov 01 '25 04:11 WuBai2005

Hi, could you please provide more information since I'm not seeing a similar error on my end? Additionally, please ensure that you have installed the packages with the recommended version.

LMMMEng avatar Nov 02 '25 11:11 LMMMEng

I've installed the paceages with the recommended and solved the problem. This is because the interface of torch.device is incompatible with MMCV, but I have modified the code and it now works.

WuBai2005 avatar Nov 09 '25 08:11 WuBai2005

from .active_rotated_filter import active_rotated_filter

File "/home/yangjie1/anaconda3/envs/overlock/lib/python3.10/site-packages/mmcv/ops/active_rotated_filter.py", line 10, in ext_module = ext_loader.load_ext( File "/home/yangjie1/anaconda3/envs/overlock/lib/python3.10/site-packages/mmcv/utils/ext_loader.py", line 13, in load_ext ext = importlib.import_module('mmcv.' + name) File "/home/yangjie1/anaconda3/envs/overlock/lib/python3.10/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ModuleNotFoundError: No module named 'mmcv._ext' 这是什么原因作者大大

zhangshuo0723 avatar Nov 21 '25 02:11 zhangshuo0723

@zhangshuo0723 Hi, 看起来可能是mmcv编译的问题,卸载然后重新安装试试看 pip uninstall mmcv mmcv-full; pip install mmcv-full==1.7.2 --no-cache-dir

LMMMEng avatar Nov 21 '25 14:11 LMMMEng

Closed as no activities remain.

LMMMEng avatar Jan 04 '26 12:01 LMMMEng