Beckschen/TransUNet

about test.py

Opened this issue · 0 comments

Traceback (most recent call last):
File "D:\CondaProjects\TransUNet-main\TransUNet\test.py", line 156, in
inference(args, net, test_save_path)
File "D:\CondaProjects\TransUNet-main\TransUNet\test.py", line 60, in inference
metric_i = test_single_volume(image, label, model, classes=args.num_classes,
File "D:\CondaProjects\TransUNet-main\TransUNet\utils.py", line 87, in test_single_volume
out = torch.argmax(torch.softmax(net(input), dim=1), dim=1).squeeze(0)
File "D:\Anaconda3\envs\python39\lib\site-packages\torch\nn\modules\module.py", line 1130, in _call_impl
return forward_call(*input, **kwargs)
File "D:\CondaProjects\TransUNet-main\TransUNet\networks\vit_seg_modeling.py", line 387, in forward
x = x.repeat(1, 3, 1, 1)
RuntimeError: Number of dimensions of repeat dims can not be smaller than number of dimensions of tensor

When I run test.py and the input channel of the testset is 3, how do I solve this problem?