-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
train error #44
Comments
nnFormerTrainerV2_Synapse 在这里设置了训练集和验证集的key,有问题应该是这里有问题 nnFormer/nnformer/training/network_training/nnFormerTrainerV2_Synapse.py Lines 311 to 314 in e20bd3b
|
已收到邮件,将尽快回复!
|
有可能是因为imagesTr 里没有img0005这一项 |
感谢回复,祝您元旦快乐!
imageTr中是有005的,难道是命名格式的问题吗?可我确实是按照nnunet要求的格式呀,而且用nnFormerTrainerV2是没有报错的
Best Wishes!
…------------------ 原始邮件 ------------------
发件人: "282857341/nnFormer" ***@***.***>;
发送时间: 2022年1月1日(星期六) 凌晨0:09
***@***.***>;
***@***.******@***.***>;
主题: Re: [282857341/nnFormer] train error (Issue #44)
有可能是因为imagesTr 里没有img0005这一项
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
能发一下报错的完整截图么 |
可以的,非常抱歉没有看到第一封邮件!
确实如您所言,报错信息提示就在311-314行,此处划分难道是需要我根据自己的任务重新写吗
Best Wishes!
…------------------ 原始邮件 ------------------
发件人: "282857341/nnFormer" ***@***.***>;
发送时间: 2022年1月1日(星期六) 凌晨0:19
***@***.***>;
***@***.******@***.***>;
主题: Re: [282857341/nnFormer] train error (Issue #44)
能发一下报错的完整截图么
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
issue似乎不能显示图片吗? |
看样子应该是 self.dataset 没有img0005这个key,你可以试着把self.dataset 的key都打印出来,正常来说应该会有30个key。 如果self.dataset的key少于30个,说明imagesTr和imagesTr少数据了,正常来说imagesTr和labelsTr里的数据也应该是30个 |
我将self.dataset打印出来了,下面是一例的内容 |
是的,如果你要用其他数据的话,就要替换掉 |
感谢!读取的error解决了,但又出现了新的问题。。。报错信息如下 L和S H W的值如下: |
如果你的输入的crop size和synapse一致应该就不会有这个问题 nnFormer/nnformer/run/default_configuration.py Lines 49 to 69 in e20bd3b
|
很抱歉再次打扰了,predict时再次遇到了问题,看了很久还是不知道应该修改哪里,所用的imagesTs和imageTr都是自己的数据集,但可以跑nnunet的代码 |
每个epoch的iteration数目是固定的,可以通过减少epoch,或者减少每个epoch的num_batches数目来减少训练时间。此外把 self.num_val_batches_per_epoch改成50把,我之前为了复现的目的,把这个值改成了167。这样能快一点。
然后predict出错的地方,具体的shape能打印出来吗 |
顺便问一下,你的数据加上背景是几类 |
pred type <class 'torch.Tensor'> |
本来这里代码设置输出通道是14,改成num_classes就行了 |
RuntimeError: Error(s) in loading state_dict for swintransformer: 新的问题出现了,应该是训练时保存模型的shape不对,这个问题修改了上面Swin_Unet_l_gelunorm.py里的代码可以解决吗,不过我应该要重新训练了 |
把trainer加载预训练权重的代码注释就行了。 nnFormer/nnformer/training/network_training/nnFormerTrainerV2_Synapse.py Lines 157 to 159 in 80fc0e0
主要训练和推理的模型变了导致的这个问题,推理的时候会重新初始化网络,然后加载预训练权重的代码写在了初始化网络的代码里,你重新训练的话这个问题就不会出现了 |
那这样的话我是不是不能在自己的数据集上使用你们的预训练模型了呢?因为我重新训练时发现如果不注释上面三行代码还是会报错。或者我应该自己训一个预训练模型吗 |
你好,请问这个问题你是怎么解决的呢? |
已收到邮件,将尽快回复!
|
请问您解决了嘛 |
已收到邮件,将尽快回复!
|
splits[self.fold]['train']=np.array(['img0006','img0007' ,'img0009', 'img0010', 'img0021' ,'img0023' ,'img0024','img0026' ,'img0027' ,'img0031', 'img0033' ,'img0034' |
我是S, H, W 32 32 32,我应该怎么修改呀 |
执行nnFormer_train 3d_fullres nnFormerTrainerV2_Synapse 2 0命令时报错KeyError: 'img0005'
是为什么呢?数据预处理以安装说明执行nnFormer_plan_and_preprocess -t 2
改为nnFormer_train 3d_fullres nnFormerTrainerV2 2 0即可run
The text was updated successfully, but these errors were encountered: