调试分割网络模型代码错误记录

  1. 错误一:
ValueError: Expected input batch_size (1) to match target batch_size (256).

 batch size不能被整除。(在训练过程中出现这个错误)

2.错误二: 

ValueError: Expected more than 1 value per channel when training, got input size torch.Size([1, 256, 1, 1])

训练还没开始就报错,batch设置为1 

3.错误三:

ModuleNotFoundError: No module named '__main__.resnet'; '__main__' is not a package

 在模型调用文件中把from .Wheel import Wheel改成 from Wheel import Wheel即可(在模型训练中想单独打印网络结构模型)

4.错误四:

AttributeError: ‘tuple‘object has no attribute ‘log_softmax‘

  AttributeError: ‘tuple‘object has no attribute ‘log_softmax‘_hye0501的博客-CSDN博客

5.

RuntimeError: stack expects each tensor to be equal size, but got [224, 224] at entry 0 and [315, 159] at entry 2

 【pytorch】【已解决】RuntimeError: stack expects each tensor to be equal size, but got [4, 448, 448] at ent_剑宇2022的博客-CSDN博客

6. 

D:\DeepLabV3Plus-Pytorch-master
Traceback (most recent call last):
  File "train.py", line 98, in 
    trainer[dataset_name](args, net, args.output_dir)
  File "/home/swin-unet-main/trainer.py", line 78, in trainer_synapse
    image = image_batch[1, 0:1, :, :]
IndexError: index 1 is out of bounds for dimension 0 with size 1

 未解决

你可能感兴趣的:(学习自存,深度学习,人工智能,神经网络)