AstarLight / Satellite-Segmentation

615 stars 233 forks source link

训练后的照片全黑 #37

Open Tangtyone opened 5 years ago

Tangtyone commented 5 years ago

我按照模型上跑,predict的照片全黑,是什么原因吗?

silveryskyer commented 5 years ago

我也是这个情况,请问您解决了么

Hydrogenion commented 5 years ago

+1 请问是什么情况

Hydrogenion commented 5 years ago

我也是这个情况,请问您解决了么

请问您解决了吗?

silveryskyer commented 5 years ago

已经解决啦,将crop的通道号换到前面就好啦------------------ 原始邮件 ------------------ 发件人: "Hydrogenion"notifications@github.com 发送时间: 2019年4月20日(星期六) 晚上7:43 收件人: "AstarLight/Satellite-Segmentation"Satellite-Segmentation@noreply.github.com; 抄送: "silveryskyer"1035609821@qq.com;"Comment"comment@noreply.github.com; 主题: Re: [AstarLight/Satellite-Segmentation] 训练后的照片全黑 (#37)

我也是这个情况,请问您解决了么

请问您解决了吗?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

Hydrogenion commented 5 years ago

我也是这个情况,请问您解决了么

还望请教一下,具体的代码是哪一行? 我使用的是tensorflow作为backend 运行时提示 DeprecationWarning: The truth value of an empty array is ambiguous. Returning False, but in future this will result in an error. Use array.size > 0 to check that an array is not empty. if diff:

Hydrogenion commented 5 years ago

已解决! 图片并非全黑,只是纹理非常暗淡。 把 cv2.imwrite('./predict/pre'+str(n+1)+'.png',mask_whole[0:h,0:w]) 改为 mask_whole[0:h, 0:w] = mask_whole[0:h,0:w] * 20 cv2.imwrite('./predict/pre'+str(n+1)+'.png',mask_whole[0:h,0:w]) 即可

silveryskyer commented 5 years ago

感谢~我也解决啦,我是因为crop获取的长宽和通道号位置不对应导致的,将通道号该到前面即可

------------------ 原始邮件 ------------------ 发件人: "Hydrogenion"notifications@github.com; 发送时间: 2019年4月20日(星期六) 晚上8:18 收件人: "AstarLight/Satellite-Segmentation"Satellite-Segmentation@noreply.github.com; 抄送: "雪花&nn"1035609821@qq.com; "Comment"comment@noreply.github.com; 主题: Re: [AstarLight/Satellite-Segmentation] 训练后的照片全黑 (#37)

已解决! 图片并非全黑,只是纹理非常暗淡。 把 cv2.imwrite('./predict/pre'+str(n+1)+'.png',mask_whole[0:h,0:w]) 改为 mask_whole[0:h, 0:w] = mask_whole[0:h,0:w] * 20 cv2.imwrite('./predict/pre'+str(n+1)+'.png',mask_whole[0:h,0:w]) 即可

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

silveryskyer commented 5 years ago

我也是tensorflow作为backend,最后查出来是这里的问题,获取的ch,cw的值和通道号错位了 crop = padding_img[:3,istride:istride+image_size,jstride:jstride+imagesize] ,ch,cw = crop.shape 最后通过将:3的位置更换和最后改变crop的结构解决的

------------------ 原始邮件 ------------------ 发件人: "Hydrogenion"notifications@github.com; 发送时间: 2019年4月20日(星期六) 晚上8:01 收件人: "AstarLight/Satellite-Segmentation"Satellite-Segmentation@noreply.github.com; 抄送: "雪花&nn"1035609821@qq.com; "Comment"comment@noreply.github.com; 主题: Re: [AstarLight/Satellite-Segmentation] 训练后的照片全黑 (#37)

我也是这个情况,请问您解决了么

还望请教一下,具体的代码是哪一行? 我使用的是tensorflow作为backend 运行时提示 DeprecationWarning: The truth value of an empty array is ambiguous. Returning False, but in future this will result in an error. Use array.size > 0 to check that an array is not empty. if diff:

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

Tangtyone commented 5 years ago

@silveryskyer @Hydrogenion 请问你们训练的时候,精度是好多啊?我的loss一直是负的,acc一直在0.3左右。

silveryskyer commented 5 years ago

我的还算正常吧,0.9+的样子------------------ 原始邮件 ------------------ 发件人: "Tangtyone"notifications@github.com 发送时间: 2019年4月20日(星期六) 晚上10:19 收件人: "AstarLight/Satellite-Segmentation"Satellite-Segmentation@noreply.github.com; 抄送: "silveryskyer"1035609821@qq.com;"Mention"mention@noreply.github.com; 主题: Re: [AstarLight/Satellite-Segmentation] 训练后的照片全黑 (#37)

@silveryskyer @Hydrogenion 请问你们训练的时候,精度是好多啊?我的loss一直是负的,acc一直在0.3左右。

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

Tangtyone commented 5 years ago

@silveryskyer 请问你在原文件中做了什么修改吗?

silveryskyer commented 5 years ago

没有把,就只有几个报错的地方改了下,我是用的作者的数据集,不知是否与数据集有关?------------------ 原始邮件 ------------------ 发件人: "Tangtyone"notifications@github.com 发送时间: 2019年4月20日(星期六) 晚上11:02 收件人: "AstarLight/Satellite-Segmentation"Satellite-Segmentation@noreply.github.com; 抄送: "silveryskyer"1035609821@qq.com;"Mention"mention@noreply.github.com; 主题: Re: [AstarLight/Satellite-Segmentation] 训练后的照片全黑 (#37)

@silveryskyer 请问你在原文件中做了什么修改吗?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

ryanhiga commented 5 years ago

已经解决啦,将crop的通道号换到前面就好啦------------------ 原始邮件 ------------------ 发件人: "Hydrogenion"notifications@github.com 发送时间: 2019年4月20日(星期六) 晚上7:43 收件人: "AstarLight/Satellite-Segmentation"Satellite-Segmentation@noreply.github.com; 抄送: "silveryskyer"1035609821@qq.com;"Comment"comment@noreply.github.com; 主题: Re: [AstarLight/Satellite-Segmentation] 训练后的照片全黑 (#37) 我也是这个情况,请问您解决了么 请问您解决了吗? — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

您好可以联系下么 qq1226292458 我做这个遇到了很多问题

silvercherry commented 5 years ago

已经解决啦,将crop的通道号换到前面就好啦------------------ 原始邮件 ------------------ 发件人: "Hydrogenion"notifications@github.com 发送时间: 2019年4月20日(星期六) 晚上7:43 收件人: "AstarLight/Satellite-Segmentation"Satellite-Segmentation@noreply.github.com; 抄送: "silveryskyer"1035609821@qq.com;"Comment"comment@noreply.github.com; 主题: Re: [AstarLight/Satellite-Segmentation] 训练后的照片全黑 (#37) 我也是这个情况,请问您解决了么 请问您解决了吗? — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

您好可以联系下么 qq1226292458 我做这个遇到了很多问题

请问一下 您的crop是怎么修改的呢 我修改后还是会全黑

silvercherry commented 5 years ago

感谢~我也解决啦,我是因为crop获取的长宽和通道号位置不对应导致的,将通道号该到前面即可 ------------------ 原始邮件 ------------------ 发件人: "Hydrogenion"notifications@github.com; 发送时间: 2019年4月20日(星期六) 晚上8:18 收件人: "AstarLight/Satellite-Segmentation"Satellite-Segmentation@noreply.github.com; 抄送: "雪花&nn"1035609821@qq.com; "Comment"comment@noreply.github.com; 主题: Re: [AstarLight/Satellite-Segmentation] 训练后的照片全黑 (#37) 已解决! 图片并非全黑,只是纹理非常暗淡。 把 cv2.imwrite('./predict/pre'+str(n+1)+'.png',mask_whole[0:h,0:w]) 改为 mask_whole[0:h, 0:w] = mask_whole[0:h,0:w] * 20 cv2.imwrite('./predict/pre'+str(n+1)+'.png',mask_whole[0:h,0:w]) 即可 — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

请问一下您的crop是怎么修改的呢 我修改后还是会全黑

qt111111 commented 3 years ago

已经解决啦,将crop的通道号换到前面就好啦------------------ 原始邮件 ------------------ 发件人: "Hydrogenion"notifications@github.com 发送时间: 2019年4月20日(星期六) 晚上7:43 收件人: "AstarLight/Satellite-Segmentation"Satellite-Segmentation@noreply.github.com; 抄送: "silveryskyer"1035609821@qq.com;"Comment"comment@noreply.github.com; 主题: Re: [AstarLight/Satellite-Segmentation] 训练后的照片全黑 (#37) 我也是这个情况,请问您解决了么 请问您解决了吗? — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

您好,我把通道改到了前面但是结果还是全黑的,请问您后半部分的代码可以分享一下吗

zhgv commented 3 years ago

没有把,就只有几个报错的地方改了下,我是用的作者的数据集,不知是否与数据集有关?------------------原始邮件------------------发件人:“ Tangtyone” notifications@github.com发送时间:2019年4月20日(星期六)晚上11:02收件人:“ AstarLight /卫星分段” Satellite-Segmentation@noreply.github.com; 抄送:“ silveryskyer” 1035609821@qq.com;“提及” mention@noreply.github.com; —主题:回复:[AstarLight / Satellite-Segmentation]训练后的照片全黑(#37) @silveryskyer请问你在华盛顿件中做了什么修改吗?您收到此邮件是因为有人提到您。直接回复此电子邮件,在GitHub上查看,或使该线程静音。

请问你怎么修改的呢?能把修改后的代码分享一下呢?