[英]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.