如題,我目前是匯入腦影像與分割結果(class=87),我目前只有修改config.py中
parser.add_argument('--n_labels', type=int, default=87,help='number of classes')
若要開始訓練則會出現以下錯誤
File "train.py", line 89, in <module> train_log = train(model, train_loader, optimizer, loss, args.n_labels, alpha) File "train.py", line 43, in train target = common.to_one_hot_3d(target,n_labels) File "/home/ma/3DUNet-Pytorch/utils/common.py", line 9, in to_one_hot_3d one_hot = torch.zeros(n, n_classes, s, h, w).scatter_(1, tensor.view(n, 1, s, h, w), 1) RuntimeError: index 87 is out of bounds for dimension 1 with size 87
如題,我目前是匯入腦影像與分割結果(class=87),我目前只有修改config.py中
parser.add_argument('--n_labels', type=int, default=87,help='number of classes')
若要開始訓練則會出現以下錯誤
File "train.py", line 89, in <module> train_log = train(model, train_loader, optimizer, loss, args.n_labels, alpha) File "train.py", line 43, in train target = common.to_one_hot_3d(target,n_labels) File "/home/ma/3DUNet-Pytorch/utils/common.py", line 9, in to_one_hot_3d one_hot = torch.zeros(n, n_classes, s, h, w).scatter_(1, tensor.view(n, 1, s, h, w), 1) RuntimeError: index 87 is out of bounds for dimension 1 with size 87