DST-CBC icon indicating copy to clipboard operation
DST-CBC copied to clipboard

迭代

Open dqq813 opened this issue 2 years ago • 9 comments

您好,请问迭代DMT的代码在哪里实现

dqq813 avatar May 29 '23 11:05 dqq813

@dqq813 每次迭代的逻辑是一样的 (pseudo label + training),所以是直接用shell文件调用python文件实现的,例如 https://github.com/voldemortX/DST-CBC/blob/master/segmentation/dmt-voc-20-1.sh

voldemortX avatar May 29 '23 13:05 voldemortX

那请问可以使用coco数据集训练吗,我自己定义的数据集是coco格式的

dqq813 avatar May 29 '23 13:05 dqq813

@dqq813 目前没适配过coco格式训练,你可以看看需不需要修改dataset代码适配你自己的格式

voldemortX avatar May 29 '23 13:05 voldemortX

您好,我在训练我自己的数据集时,出现了这个问题,请问应该怎么解决? /pytorch/aten/src/ATen/native/cuda/ScatterGatherKernel.cu:86: operator(): block: [610,0,0], thread: [23,0,0] Assertion idx_dim >= 0 && idx_dim < index_size && "index out of bounds" failed. /pytorch/aten/src/ATen/native/cuda/ScatterGatherKernel.cu:86: operator(): block: [610,0,0], thread: [24,0,0] Assertion idx_dim >= 0 && idx_dim < index_size && "index out of bounds" failed. /pytorch/aten/src/ATen/native/cuda/ScatterGatherKernel.cu:86: operator(): block: [648,0,0], thread: [62,0,0] Assertion idx_dim >= 0 && idx_dim < index_size && "index out of bounds" failed. /pytorch/aten/src/ATen/native/cuda/ScatterGatherKernel.cu:86: operator(): block: [648,0,0], thread: [63,0,0] Assertion idx_dim >= 0 && idx_dim < index_size && "index out of bounds" failed. /pytorch/aten/src/ATen/native/cuda/ScatterGatherKernel.cu:86: operator(): block: [691,0,0], thread: [13,0,0] Assertion idx_dim >= 0 && idx_dim < index_size && "index out of bounds" failed. /pytorch/aten/src/ATen/native/cuda/ScatterGatherKernel.cu:86: operator(): block: [691,0,0], thread: [14,0,0] Assertion idx_dim >= 0 && idx_dim < index_size && "index out of bounds" failed. /pytorch/aten/src/ATen/native/cuda/ScatterGatherKernel.cu:86: operator(): block: [691,0,0], thread: [15,0,0] Assertion idx_dim >= 0 && idx_dim < index_size && "index out of bounds" failed. /pytorch/aten/src/ATen/native/cuda/ScatterGatherKernel.cu:86: operator(): block: [691,0,0], thread: [16,0,0] Assertion idx_dim >= 0 && idx_dim < index_size && "index out of bounds" failed. /pytorch/aten/src/ATen/native/cuda/ScatterGatherKernel.cu:86: operator(): block: [691,0,0], thread: [24,0,0] Assertion idx_dim >= 0 && idx_dim < index_size && "index out of bounds" failed. /pytorch/aten/src/ATen/native/cuda/ScatterGatherKernel.cu:86: operator(): block: [691,0,0], thread: [25,0,0] Assertion idx_dim >= 0 && idx_dim < index_size && "index out of bounds" failed. /pytorch/aten/src/ATen/native/cuda/ScatterGatherKernel.cu:86: operator(): block: [691,0,0], thread: [26,0,0] Assertion idx_dim >= 0 && idx_dim < index_size && "index out of bounds" failed. /pytorch/aten/src/ATen/native/cuda/ScatterGatherKernel.cu:86: operator(): block: [691,0,0], thread: [27,0,0] Assertion idx_dim >= 0 && idx_dim < index_size && "index out of bounds" failed. /pytorch/aten/src/ATen/native/cuda/ScatterGatherKernel.cu:86: operator(): block: [691,0,0], thread: [28,0,0] Assertion idx_dim >= 0 && idx_dim < index_size && "index out of bounds" failed. /pytorch/aten/src/ATen/native/cuda/ScatterGatherKernel.cu:86: operator(): block: [691,0,0], thread: [29,0,0] Assertion idx_dim >= 0 && idx_dim < index_size && "index out of bounds" failed. /pytorch/aten/src/ATen/native/cuda/ScatterGatherKernel.cu:86: operator(): block: [691,0,0], thread: [30,0,0] Assertion idx_dim >= 0 && idx_dim < index_size && "index out of bounds" failed. Traceback (most recent call last): File "main.py", line 507, in val_num_steps=args.val_num_steps, input_sizes=input_sizes) File "main.py", line 215, in train loss, stats = criterion(outputs, probs, inputs_c.shape[0]) File "/home/dqq/anaconda3/envs/dmt/lib/python3.7/site-packages/torch/nn/modules/module.py", line 722, in _call_impl result = self.forward(*input, **kwargs) File "/home/dqq/project/DST-CBC/segmentation/utils/losses.py", line 95, in forward stats['disagree'] = (disagreement * (real_targets != self.ignore_index))[:split_index].sum().int().item() RuntimeError: CUDA error: device-side assert triggered

dqq813 avatar Jun 04 '23 06:06 dqq813

@dqq813 建议检查一下类别数量等修改有没有造成下标溢出

voldemortX avatar Jun 04 '23 09:06 voldemortX

@dqq813 建议检查一下类别数量等修改有没有造成下标溢出

已解决,谢谢您

dqq813 avatar Jun 04 '23 13:06 dqq813

for key in coco: if 'layer5' in key: my_key = 'classifier.0.convs' + key.split('conv2d_list')[1] else: my_key = 'backbone.' + key if my_voc[my_key].shape == coco[key].shape: voc_shape_match += 1 my_voc[my_key] = coco[key] else: voc_shape_not_match += 1 if my_city[my_key].shape == coco[key].shape: city_shape_match += 1 my_city[my_key] = coco[key] else: city_shape_not_match += 1 您好,我想请问一下,这里为什么使用coco预训练权重中的layer5初始化deeplabv2中的classifier呢,如果想初始化deeplabv3中的classifier,应该使用哪层的权重初始化呢

dqq813 avatar Jun 19 '23 13:06 dqq813

for key in coco: if 'layer5' in key: my_key = 'classifier.0.convs' + key.split('conv2d_list')[1] else: my_key = 'backbone.' + key if my_voc[my_key].shape == coco[key].shape: voc_shape_match += 1 my_voc[my_key] = coco[key] else: voc_shape_not_match += 1 if my_city[my_key].shape == coco[key].shape: city_shape_match += 1 my_city[my_key] = coco[key] else: city_shape_not_match += 1 您好,我想请问一下,这里为什么使用coco预训练权重中的layer5初始化deeplabv2中的classifier呢,如果想初始化deeplabv3中的classifier,应该使用哪层的权重初始化呢

这个还真没研究过,估计是从第一篇半监督分割(Advsemiseg Hung et al. 你应该听说过吧)抄来的,为了保持统一。

voldemortX avatar Jun 19 '23 13:06 voldemortX

for key in coco: if 'layer5' in key: my_key = 'classifier.0.convs' + key.split('conv2d_list')[1] else: my_key = 'backbone.' + key if my_voc[my_key].shape == coco[key].shape: voc_shape_match += 1 my_voc[my_key] = coco[key] else: voc_shape_not_match += 1 if my_city[my_key].shape == coco[key].shape: city_shape_match += 1 my_city[my_key] = coco[key] else: city_shape_not_match += 1 您好,我想请问一下,这里为什么使用coco预训练权重中的layer5初始化deeplabv2中的classifier呢,如果想初始化deeplabv3中的classifier,应该使用哪层的权重初始化呢

这个还真没研究过,估计是从第一篇半监督分割(Advsemiseg Hung et al. 你应该听说过吧)抄来的,为了保持统一。

好的,谢谢您,我去看一下。

dqq813 avatar Jun 19 '23 13:06 dqq813