Medical-Transformer icon indicating copy to clipboard operation
Medical-Transformer copied to clipboard

RuntimeError: invalid argument 0: Sizes of tensors must match except in dimension 0

Open Deerzh opened this issue 1 year ago • 1 comments

when I run this command: python train.py --train_dataset "Traindata" --val_dataset "Traindata" --direc 'result' --batch_size 4 --epoch 400 --save_freq 10 --modelname "gatedaxialunet" --learning_rate 0.001 --imgsize 128 --gray "no", then an error occurred. Can you help me fix this issue?

RuntimeError: invalid argument 0: Sizes of tensors must match except in dimension 0. Got 522 and 453 in dimension 2 at /opt/conda/conda-bld/pytorch_1579022034529/work/aten/src/TH/generic/THTensor.cpp:612

Deerzh avatar Aug 01 '22 04:08 Deerzh

Hi, did you solve the issue? I have same problem

YHYeooooong avatar Dec 21 '22 00:12 YHYeooooong