简体   繁体   English

语义分割任务的输出

[英]ouputs in semantic segmentation task

Im working on the Kaggle semantic segmentation task, 我正在执行Kaggle语义细分任务,

In the testing part of my code, 在我的代码的测试部分,

model = model.eval()
predictions =[]
for data in testdataloader:
    data = t.autograd.Variable(data, volatile=True).cuda()
    output = model.forward(data)
    _,preds = t.max(output, 1, keepdim = True)

when i do the preds part,the array is only filled with ,i was hoping it to be an array of maximum locations im not sure what is going wrong. 当我做preds部分时,该数组仅被填充,我希望它是最大位置的数组,不确定到底出了什么问题。 The output part works well,I have attached a screenshot for visualization of output output部分效果很好,我附加了一个屏幕截图,用于可视化output 在此处输入图片说明

Any sugestions on what is going wrong would be really helpful. 任何暗示出了什么问题都会很有帮助。

thanks 谢谢

Assuming your data is of the form MiniBatch x Dim what you are doing now is looking at which minibatch has the highest value. 假设您的数据采用MiniBatch x Dim格式,那么您现在正在查看哪个minibatch具有最高的价值。 If you are testing it with a single sample ( MB = 1 ) then you will always get 0 as your answer. 如果使用单个样本( MB = 1 )进行测试,则答案总是为0 Thus, you might want to try: 因此,您可能想尝试:

_,preds = t.max(output, 0, keepdim = False)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 用于3D语义分割任务的Keras预处理 - Keras preprocessing for 3D semantic segmentation task (图像,掩码)对在语义分割任务中彼此不匹配 - (image, mask) pair do not match one another in a semantic segmentation task 读取 tensorflow 中带有索引颜色值的图像,用于语义分割任务 - Read image in tensorflow with indexed color value for semantic segmentation task Pytorch unet 语义分割 - Pytorch unet semantic segmentation 语义分割中的数据集拆分 - Dataset spliting in semantic segmentation 边界框的语义分割 - Semantic Segmentation to Bounding Boxes 为什么我的神经网络将所有东西都识别为语义分割任务的人或背景? - Why does my neural net identify everything as person or background for a semantic segmentation task? 多类语义分割任务的交并联合(IOU)度量 - Intersection over union (IOU) metric for multi-class semantic segmentation task 如何在语义分割任务中使用 tf.dataset 处理图像和掩码? - How to deal with images and masks using tf.dataset in a semantic segmentation task? 使用 Deeplabv3+ keras 进行二元语义分割(专为多类语义分割而设计) - Binary semantic Segmentation with Deeplabv3+ keras (designed for multiclass semantic segmentation)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM