Shank2358 / NPMMR-Det

This is a PyTorch implementation of NPMMR-Det
Apache License 2.0
50 stars 3 forks source link

缺少文件 #2

Closed so-bright closed 3 years ago

so-bright commented 3 years ago

from ..layers.directional_dynamic_convolution import *

目录下没有directional_dynamic_convolution文件

Shank2358 commented 3 years ago

没用到这个库,注释掉就行。有报错说找不到的把它注释掉,因为这个代码是从我的大框架里拆出来的,可能有的没有删干净。

Shank2358 commented 3 years ago

nal_dynamic_convolution

我刚修改了这个bug

so-bright commented 3 years ago

你好,在LOdet里面,运行的时候有这个bug self.head_s = DSC_Head(nC=self.nC, anchors=self.anchors[0], stride=self.strides[0]) TypeError: init() missing 1 required positional argument: 'fact'

Shank2358 commented 3 years ago

你好,在LOdet里面,运行的时候有这个bug self.head_s = DSC_Head(nC=self.nC, anchors=self.anchors[0], stride=self.strides[0]) TypeError: init() missing 1 required positional argument: 'fact'

有完整的错误日志吗

so-bright commented 3 years ago

Traceback (most recent call last): File "trainR.py", line 205, in Trainer(weight_path=opt.weight_path, resume=opt.resume, gpu_id=opt.gpu_id).train() File "trainR.py", line 38, in init net_model = LODet() File "/home/yc/LO-Det-main/modelR/lodet.py", line 21, in init self.head_s = DSC_Head(nC=self.nC, anchors=self.anchors[0], stride=self.strides[0]) TypeError: init() missing 1 required positional argument: 'fact'

Shank2358 commented 3 years ago

Traceback (most recent call last): File "trainR.py", line 205, in Trainer(weight_path=opt.weight_path, resume=opt.resume, gpu_id=opt.gpu_id).train() File "trainR.py", line 38, in init net_model = LODet() File "/home/yc/LO-Det-main/modelR/lodet.py", line 21, in init self.head_s = DSC_Head(nC=self.nC, anchors=self.anchors[0], stride=self.strides[0]) TypeError: init() missing 1 required positional argument: 'fact'

OK我再试一下,我这边运行没有这个错,估计是编译器或环境的问题。 我这边刚更新了一下lodet的仓库,有几个文件名错误的bug我刚改了。

Shank2358 commented 3 years ago

self.head_s = DSC_Head(nC=self.nC, anchors=self.anchors[0], stride=self.strides[0]) TypeError: init() missing 1 required positional argument: 'fact'

又更新了,bug是DSC_Head函数里面有一个self.fact=fact没用到,把这个变量删掉就行了 你再试试看现在的行不行 image

so-bright commented 3 years ago

好 谢谢! backbone的预训练权重您有吗,这有点难找,或者在哪设置不使用预训练权重

Shank2358 commented 3 years ago

好 谢谢! backbone的预训练权重您有吗,这有点难找,或者在哪设置不使用预训练权重

NPMMR的预训练权重和我论文里训练完的权重都在网盘里了,readme有链接。LODet的预训练权重在weight文件夹下,有mobilenet2\shufflenet2\ghostnet等好几种,我论文里训练好的权重我现在就转换上传(可能要稍后几个小时),最近事儿多没顾上这个。 不要预训练权重就把train里面这个改为None就行 parser.add_argument('--weight_path', type=str, default='weight/darknet53_448.weights', help='weight file path') #不要预训练就改为default=None

so-bright commented 3 years ago

lodet还是有点bug Traceback (most recent call last): File "trainR.py", line 205, in Trainer(weight_path=opt.weight_path, resume=opt.resume, gpu_id=opt.gpu_id).train() File "trainR.py", line 117, in train sbboxes, mbboxes, lbboxes) in enumerate(self.train_dataloader): File "/home/yc/anaconda3/envs/torch1.7/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 435, in next data = self._next_data() File "/home/yc/anaconda3/envs/torch1.7/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 1085, in _next_data return self._process_data(data) File "/home/yc/anaconda3/envs/torch1.7/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 1111, in _process_data data.reraise() File "/home/yc/anaconda3/envs/torch1.7/lib/python3.7/site-packages/torch/_utils.py", line 428, in reraise raise self.exc_type(msg) IndexError: Caught IndexError in DataLoader worker process 0. Original Traceback (most recent call last): File "/home/yc/anaconda3/envs/torch1.7/lib/python3.7/site-packages/torch/utils/data/_utils/worker.py", line 198, in _worker_loop data = fetcher.fetch(index) File "/home/yc/anaconda3/envs/torch1.7/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "/home/yc/anaconda3/envs/torch1.7/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in data = [self.dataset[idx] for idx in possibly_batched_index] File "/home/yc/LO-Det-main/dataloadR/datasets.py", line 30, in getitem img_org, bboxes_org = self.parse_annotation(self.annotations[item]) File "/home/yc/LO-Det-main/dataloadR/datasets.py", line 70, in parse_annotation img, bboxes = DataAug.RandomVerticalFilp()(np.copy(img), np.copy(bboxes)) File "/home/yc/LO-Det-main/dataloadR/augmentations.py", line 128, in call__ bboxes[:, [6, 8, 10, 12]] = h_img - bboxes[:, [6, 8, 10, 12]] IndexError: index 6 is out of bounds for axis 1 with size 5

so-bright commented 3 years ago

这个应该是图像增强的部分

Shank2358 commented 3 years ago

这个应该是图像增强的部分

这个是旋转边界框的代码。。。。。OBB的标注的,普通水平框的不能用这个,用旧版那个NPMMR里面那个

Shank2358 commented 3 years ago

这个应该是图像增强的部分

这个是旋转边界框的代码。。。。。OBB的标注的,普通水平框的不能用这个,用旧版那个NPMMR里面那个

更新了一下,head增加了一个dsc_head_hbb.py文件,这个是HBB的head,模型换成这个。然后数据增强改用dataload文件夹而不是dataloadR文件夹就行了,其他HBB的函数到NPMMR仓库找就行

so-bright commented 3 years ago

谢谢!