I have a question about the radiation matrix #8244
Unanswered
amirou-hey
asked this question in
Q&A
Replies: 1 comment 1 reply
-
My input data is CT image, dimension is (1,412,410,267), label dimension is the same, CT image spatial resolution is (0.3, 0.3, 0.3), RoiSize in the code is (128,128,128) |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
There is no problem with the training process, the following error occurs when testing at the end of training:
Traceback (most recent call last):
File "/root/autodl-tmp/SwinUnet3D/demo/Brats2021_1/CariesDataTrain.py", line 774, in
main(name, g_seed)
File "/root/autodl-tmp/SwinUnet3D/demo/Brats2021_1/CariesDataTrain.py", line 757, in main
trainer.predict(model, datamodule=data)
File "/root/miniconda3/envs/lstenv1/lib/python3.9/site-packages/pytorch_lightning/trainer/trainer.py", line 986, in predict
return self._call_and_handle_interrupt(
File "/root/miniconda3/envs/lstenv1/lib/python3.9/site-packages/pytorch_lightning/trainer/trainer.py", line 682, in _call_and_handle_interrupt
return trainer_fn(*args, **kwargs)
File "/root/miniconda3/envs/lstenv1/lib/python3.9/site-packages/pytorch_lightning/trainer/trainer.py", line 1030, in _predict_impl
results = self._run(model, ckpt_path=self.predicted_ckpt_path)
File "/root/miniconda3/envs/lstenv1/lib/python3.9/site-packages/pytorch_lightning/trainer/trainer.py", line 1193, in _run
self._dispatch()
File "/root/miniconda3/envs/lstenv1/lib/python3.9/site-packages/pytorch_lightning/trainer/trainer.py", line 1270, in _dispatch
self.training_type_plugin.start_predicting(self)
File "/root/miniconda3/envs/lstenv1/lib/python3.9/site-packages/pytorch_lightning/plugins/training_type/training_type_plugin.py", line 210, in start_predicting
self._results = trainer.run_stage()
File "/root/miniconda3/envs/lstenv1/lib/python3.9/site-packages/pytorch_lightning/trainer/trainer.py", line 1281, in run_stage
return self._run_predict()
File "/root/miniconda3/envs/lstenv1/lib/python3.9/site-packages/pytorch_lightning/trainer/trainer.py", line 1343, in _run_predict
return self.predict_loop.run()
File "/root/miniconda3/envs/lstenv1/lib/python3.9/site-packages/pytorch_lightning/loops/base.py", line 145, in run
self.advance(*args, **kwargs)
File "/root/miniconda3/envs/lstenv1/lib/python3.9/site-packages/pytorch_lightning/loops/dataloader/prediction_loop.py", line 91, in advance
dl_predictions, dl_batch_indices = self.epoch_loop.run(
File "/root/miniconda3/envs/lstenv1/lib/python3.9/site-packages/pytorch_lightning/loops/base.py", line 145, in run
self.advance(*args, **kwargs)
File "/root/miniconda3/envs/lstenv1/lib/python3.9/site-packages/pytorch_lightning/loops/epoch/prediction_epoch_loop.py", line 90, in advance
batch_idx, batch = next(dataloader_iter)
File "/root/miniconda3/envs/lstenv1/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 634, in next
data = self._next_data()
File "/root/miniconda3/envs/lstenv1/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 1346, in _next_data
return self._process_data(data)
File "/root/miniconda3/envs/lstenv1/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 1372, in _process_data
data.reraise()
File "/root/miniconda3/envs/lstenv1/lib/python3.9/site-packages/torch/_utils.py", line 644, in reraise
raise exception
RuntimeError: Caught RuntimeError in DataLoader worker process 0.
Original Traceback (most recent call last):
File "/root/miniconda3/envs/lstenv1/lib/python3.9/site-packages/monai/transforms/transform.py", line 141, in apply_transform
return _apply_transform(transform, data, unpack_items, lazy, overrides, log_stats)
File "/root/miniconda3/envs/lstenv1/lib/python3.9/site-packages/monai/transforms/transform.py", line 98, in _apply_transform
return transform(data, lazy=lazy) if isinstance(transform, LazyTrait) else transform(data)
File "/root/miniconda3/envs/lstenv1/lib/python3.9/site-packages/monai/transforms/io/dictionary.py", line 163, in call
data = self._loader(d[key], reader)
File "/root/miniconda3/envs/lstenv1/lib/python3.9/site-packages/monai/transforms/io/array.py", line 291, in call
img_array, meta_data = reader.get_data(img)
File "/root/miniconda3/envs/lstenv1/lib/python3.9/site-packages/monai/data/image_reader.py", line 964, in get_data
_copy_compatible_dict(header, compatible_meta)
File "/root/miniconda3/envs/lstenv1/lib/python3.9/site-packages/monai/data/image_reader.py", line 129, in _copy_compatible_dict
raise RuntimeError(
RuntimeError: affine matrix of all images should be the same for channel-wise concatenation. Got [[ -0.30000001 0. 0. 61.5 ]
[ -0. 0.30000001 0. -61.20000458]
[ 0. -0. 0.30000001 -41.25 ]
[ 0. 0. 0. 1. ]] and [[ -0.30000001 0. 0. 61.5 ]
[ -0. 0.30000001 0. -61.20000458]
[ 0. -0. 0.30000001 -40.04999924]
[ 0. 0. 0. 1. ]].
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/root/miniconda3/envs/lstenv1/lib/python3.9/site-packages/torch/utils/data/_utils/worker.py", line 308, in _worker_loop
data = fetcher.fetch(index)
File "/root/miniconda3/envs/lstenv1/lib/python3.9/site-packages/torch/utils/data/_utils/fetch.py", line 51, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/root/miniconda3/envs/lstenv1/lib/python3.9/site-packages/torch/utils/data/_utils/fetch.py", line 51, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/root/miniconda3/envs/lstenv1/lib/python3.9/site-packages/monai/data/dataset.py", line 108, in getitem
return self._transform(index)
File "/root/miniconda3/envs/lstenv1/lib/python3.9/site-packages/monai/data/dataset.py", line 94, in _transform
return self.transform(data_i)
File "/root/miniconda3/envs/lstenv1/lib/python3.9/site-packages/monai/transforms/compose.py", line 335, in call
result = execute_compose(
File "/root/miniconda3/envs/lstenv1/lib/python3.9/site-packages/monai/transforms/compose.py", line 111, in execute_compose
data = apply_transform(
File "/root/miniconda3/envs/lstenv1/lib/python3.9/site-packages/monai/transforms/transform.py", line 171, in apply_transform
raise RuntimeError(f"applying transform {transform}") from e
RuntimeError: applying transform <monai.transforms.io.dictionary.LoadImaged object at 0x7feced41b9d0>
Predicting: 2it [00:02, ?it/s]
Beta Was this translation helpful? Give feedback.
All reactions