qiaofengsheng / pytorch-UNet

pytorch搭建自己的unet网络,训练自己的数据集。
Other
265 stars 28 forks source link

采用自己数据集,显示超出界限,目前也看不到如何修改类名?请指教 #7

Open guoyanzhongwgfufg opened 1 year ago

guoyanzhongwgfufg commented 1 year ago

return torch._C._nn.cross_entropy_loss(input, target, weight, _Reduction.get_enum(reduction), ignore_index, label_smoothing)

IndexError: Target 3 is out of bounds.

qiaofengsheng commented 1 year ago

代码中有一个num_classes

------------------ 原始邮件 ------------------ 发件人: "qiaofengsheng/pytorch-UNet" @.>; 发送时间: 2022年11月2日(星期三) 下午5:17 @.>; @.***>; 主题: [qiaofengsheng/pytorch-UNet] 采用自己数据集,显示超出界限,目前也看不到如何修改类名?请指教 (Issue #7)

return torch._C._nn.cross_entropy_loss(input, target, weight, _Reduction.get_enum(reduction), ignore_index, label_smoothing)

IndexError: Target 3 is out of bounds.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>

guoyanzhongwgfufg commented 1 year ago

您好,邮件我已收到,我会尽快处理,谢谢。

guoyanzhongwgfufg commented 1 year ago

请问1、为什么你的训练图片是三合一(原图+标注图+训练图),我这边打开train_image里面只有几张黑的标签图。

------------------ 原始邮件 ------------------ 发件人: "qiaofengsheng/pytorch-UNet" @.>; 发送时间: 2022年11月2日(星期三) 下午5:46 @.>; @.**@.>; 主题: Re: [qiaofengsheng/pytorch-UNet] 采用自己数据集,显示超出界限,目前也看不到如何修改类名?请指教 (Issue #7)

代码中有一个num_classes

------------------ 原始邮件 ------------------ 发件人: "qiaofengsheng/pytorch-UNet" @.>; 发送时间: 2022年11月2日(星期三) 下午5:17 @.>; @.***>; 主题: [qiaofengsheng/pytorch-UNet] 采用自己数据集,显示超出界限,目前也看不到如何修改类名?请指教 (Issue #7)

return torch._C._nn.cross_entropy_loss(input, target, weight, _Reduction.get_enum(reduction), ignore_index, label_smoothing)

IndexError: Target 3 is out of bounds.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.> — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.>

guoyanzhongwgfufg commented 1 year ago

请问1、为什么你的训练图片是三合一(原图+标注图+训练图),我这边打开train_image里面只有几张黑的标签图。

------------------ 原始邮件 ------------------ 发件人: "qiaofengsheng/pytorch-UNet" @.>; 发送时间: 2022年11月2日(星期三) 下午5:46 @.>; @.**@.>; 主题: Re: [qiaofengsheng/pytorch-UNet] 采用自己数据集,显示超出界限,目前也看不到如何修改类名?请指教 (Issue #7)

代码中有一个num_classes

------------------ 原始邮件 ------------------ 发件人: "qiaofengsheng/pytorch-UNet" @.>; 发送时间: 2022年11月2日(星期三) 下午5:17 @.>; @.***>; 主题: [qiaofengsheng/pytorch-UNet] 采用自己数据集,显示超出界限,目前也看不到如何修改类名?请指教 (Issue #7)

return torch._C._nn.cross_entropy_loss(input, target, weight, _Reduction.get_enum(reduction), ignore_index, label_smoothing)

IndexError: Target 3 is out of bounds.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.> — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.>

guoyanzhongwgfufg commented 1 year ago

请问这个也没有终止然后产生权重文件吧?感觉理解代码思路很好,但是他并不是完整。

------------------ 原始邮件 ------------------ 发件人: "qiaofengsheng/pytorch-UNet" @.>; 发送时间: 2022年11月2日(星期三) 下午5:46 @.>; @.**@.>; 主题: Re: [qiaofengsheng/pytorch-UNet] 采用自己数据集,显示超出界限,目前也看不到如何修改类名?请指教 (Issue #7)

代码中有一个num_classes

------------------ 原始邮件 ------------------ 发件人: "qiaofengsheng/pytorch-UNet" @.>; 发送时间: 2022年11月2日(星期三) 下午5:17 @.>; @.***>; 主题: [qiaofengsheng/pytorch-UNet] 采用自己数据集,显示超出界限,目前也看不到如何修改类名?请指教 (Issue #7)

return torch._C._nn.cross_entropy_loss(input, target, weight, _Reduction.get_enum(reduction), ignore_index, label_smoothing)

IndexError: Target 3 is out of bounds.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.> — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.>

guoyanzhongwgfufg commented 1 year ago

size mismatch for out.weight: copying a param with shape torch.Size([4, 64, 3, 3]) from checkpoint, the shape in current model is torch.Size([3, 64, 3, 3]). size mismatch for out.bias: copying a param with shape torch.Size([4]) from checkpoint, the shape in current model is torch.Size([3]).

这个错误遇到过嘛?

------------------ 原始邮件 ------------------ 发件人: "qiaofengsheng/pytorch-UNet" @.>; 发送时间: 2022年11月2日(星期三) 下午5:46 @.>; @.**@.>; 主题: Re: [qiaofengsheng/pytorch-UNet] 采用自己数据集,显示超出界限,目前也看不到如何修改类名?请指教 (Issue #7)

代码中有一个num_classes

------------------ 原始邮件 ------------------ 发件人: "qiaofengsheng/pytorch-UNet" @.>; 发送时间: 2022年11月2日(星期三) 下午5:17 @.>; @.***>; 主题: [qiaofengsheng/pytorch-UNet] 采用自己数据集,显示超出界限,目前也看不到如何修改类名?请指教 (Issue #7)

return torch._C._nn.cross_entropy_loss(input, target, weight, _Reduction.get_enum(reduction), ignore_index, label_smoothing)

IndexError: Target 3 is out of bounds.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.> — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.>