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

请问超参数num_domains=1是正确的吗,为什么但我设置num_domains=1报错了,设置为=2没问题 #17

Open
hkxxxxx opened this issue Jan 20, 2024 · 0 comments

Comments

@hkxxxxx
Copy link

hkxxxxx commented Jan 20, 2024

报错内容:
Traceback (most recent call last):
File "/home/compare/train_3d_DAG4MIA.py", line 295, in
seg_pred_t, high_r_t_tb = model(img_t, domain_label=1)
File "/usr/local/miniconda3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/usr/local/miniconda3/lib/python3.8/site-packages/torch/nn/parallel/data_parallel.py", line 171, in forward
outputs = self.parallel_apply(replicas, inputs, kwargs)
File "/usr/local/miniconda3/lib/python3.8/site-packages/torch/nn/parallel/data_parallel.py", line 181, in parallel_apply
return parallel_apply(replicas, inputs, kwargs, self.device_ids[:len(replicas)])
File "/usr/local/miniconda3/lib/python3.8/site-packages/torch/nn/parallel/parallel_apply.py", line 89, in parallel_apply
output.reraise()
File "/usr/local/miniconda3/lib/python3.8/site-packages/torch/_utils.py", line 644, in reraise
raise exception
IndexError: Caught IndexError in replica 0 on device 0.
Original Traceback (most recent call last):
File "/usr/local/miniconda3/lib/python3.8/site-packages/torch/nn/parallel/parallel_apply.py", line 64, in _worker
output = module(*input, **kwargs)
File "/usr/local/miniconda3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/home/compare/models/networks/cscada_net.py", line 62, in forward
conv1 = self.conv1(x, domain_label)
File "/usr/local/miniconda3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/home/compare/models/networks/cscada_net.py", line 106, in forward
x = self.bn(x, domain_label)
File "/usr/local/miniconda3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/home/compare/models/layers/dsbn.py", line 28, in forward
bn = self.bns[domain_label]
File "/usr/local/miniconda3/lib/python3.8/site-packages/torch/nn/modules/container.py", line 295, in getitem
return self._modules[self._get_abs_string_index(idx)]
File "/usr/local/miniconda3/lib/python3.8/site-packages/torch/nn/modules/container.py", line 285, in _get_abs_string_index
raise IndexError('index {} is out of range'.format(idx))
IndexError: index 1 is out of range

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

No branches or pull requests

1 participant