You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I'm having trouble using the code to train on my own dataset. The problem occurs with the Gaussian_Diffusion module.
The question is as follows:
Traceback (most recent call last):
File "scripts/segmentation_train.py", line 118, in
main()
File "scripts/segmentation_train.py", line 70, in main
TrainLoop(
File "E:\MedSegDiff-Spine-main.\guided_diffusion\train_util.py", line 180, in run_loop
self.run_step(batch, cond)
File "E:\MedSegDiff-Spine-main.\guided_diffusion\train_util.py", line 201, in run_step
sample = self.forward_backward(batch, cond)
File "E:\MedSegDiff-Spine-main.\guided_diffusion\train_util.py", line 231, in forward_backward
losses1 = compute_losses()
File "E:\MedSegDiff-Spine-main.\guided_diffusion\gaussian_diffusion.py", line 650, in training_losses_segmentation
terms["loss"] = self._vb_terms_bpd(
File "E:\MedSegDiff-Spine-main.\guided_diffusion\gaussian_diffusion.py", line 614, in _vb_terms_bpd
out = self.p_mean_variance(
File "E:\MedSegDiff-Spine-main.\guided_diffusion\respace.py", line 90, in p_mean_variance
return super().p_mean_variance(self._wrap_model(model), *args, **kwargs)
File "E:\MedSegDiff-Spine-main.\guided_diffusion\gaussian_diffusion.py", line 267, in p_mean_variance
model_mean = self.q_posterior_mean_variance(
File "E:\MedSegDiff-Spine-main.\guided_diffusion\gaussian_diffusion.py", line 212, in q_posterior_mean_variance
assert x_start.shape == x_t.shape
AttributeError: 'tuple' object has no attribute 'shape'
Hi, I'm having trouble using the code to train on my own dataset. The problem occurs with the Gaussian_Diffusion module.
The question is as follows:
Traceback (most recent call last):
File "scripts/segmentation_train.py", line 118, in
main()
File "scripts/segmentation_train.py", line 70, in main
TrainLoop(
File "E:\MedSegDiff-Spine-main.\guided_diffusion\train_util.py", line 180, in run_loop
self.run_step(batch, cond)
File "E:\MedSegDiff-Spine-main.\guided_diffusion\train_util.py", line 201, in run_step
sample = self.forward_backward(batch, cond)
File "E:\MedSegDiff-Spine-main.\guided_diffusion\train_util.py", line 231, in forward_backward
losses1 = compute_losses()
File "E:\MedSegDiff-Spine-main.\guided_diffusion\gaussian_diffusion.py", line 650, in training_losses_segmentation
terms["loss"] = self._vb_terms_bpd(
File "E:\MedSegDiff-Spine-main.\guided_diffusion\gaussian_diffusion.py", line 614, in _vb_terms_bpd
out = self.p_mean_variance(
File "E:\MedSegDiff-Spine-main.\guided_diffusion\respace.py", line 90, in p_mean_variance
return super().p_mean_variance(self._wrap_model(model), *args, **kwargs)
File "E:\MedSegDiff-Spine-main.\guided_diffusion\gaussian_diffusion.py", line 267, in p_mean_variance
model_mean = self.q_posterior_mean_variance(
File "E:\MedSegDiff-Spine-main.\guided_diffusion\gaussian_diffusion.py", line 212, in q_posterior_mean_variance
assert x_start.shape == x_t.shape
AttributeError: 'tuple' object has no attribute 'shape'
The format of x_start is:
x_start type: <class 'tuple'>, value: (tensor([[[[0., 0., 0., ..., 0., 0., 0.],
[0., 0., 0., ..., 0., 0., 0.],
[0., 0., 0., ..., 0., 0., 0.],
...,
[0., 0., 0., ..., 0., 0., 0.],
[0., 0., 0., ..., 0., 0., 0.],
[0., 0., 0., ..., 0., 0., 0.]],
Would you please help me solve this problem?Thank you! @WuJunde
The text was updated successfully, but these errors were encountered: