Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

迭代 #16

Open
dqq813 opened this issue May 29, 2023 · 9 comments
Open

迭代 #16

dqq813 opened this issue May 29, 2023 · 9 comments
Labels
question Further information is requested

Comments

@dqq813
Copy link

dqq813 commented May 29, 2023

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

@dqq813 dqq813 changed the title 相互训练 迭代 May 29, 2023
@voldemortX
Copy link
Owner

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

@voldemortX voldemortX added the question Further information is requested label May 29, 2023
@dqq813
Copy link
Author

dqq813 commented May 29, 2023

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

@voldemortX
Copy link
Owner

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

@dqq813
Copy link
Author

dqq813 commented Jun 4, 2023

您好,我在训练我自己的数据集时,出现了这个问题,请问应该怎么解决?
/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

@voldemortX
Copy link
Owner

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

@dqq813
Copy link
Author

dqq813 commented Jun 4, 2023

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

已解决,谢谢您

@dqq813
Copy link
Author

dqq813 commented Jun 19, 2023

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,应该使用哪层的权重初始化呢

@voldemortX
Copy link
Owner

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
Copy link
Author

dqq813 commented Jun 19, 2023

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. 你应该听说过吧)抄来的,为了保持统一。

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants