Giter VIP home page Giter VIP logo

Comments (13)

zlckanata avatar zlckanata commented on July 20, 2024

应该是数据的问题,建议检查一下 "dataset/train/" 这个文件夹下的数据,如果你把deepglobe的训练数据解压在这里,应该直接就能运行起来。

from deepglobe-road-extraction-challenge.

zxshi avatar zxshi commented on July 20, 2024

好的,谢谢!
1、我先尝试了使用deepglobe的数据进行训练,成功了。
如果用Python3会遇到了这个问题:
Traceback (most recent call last):
File "train.py", line 44, in
for img, mask in data_loader_iter:
File "/home/szx/Software/anaconda3/envs/python-3.5/lib/python3.5/site-packages/torch/utils/data/dataloader.py", line 210, in next
return self._process_next_batch(batch)
File "/home/szx/Software/anaconda3/envs/python-3.5/lib/python3.5/site-packages/torch/utils/data/dataloader.py", line 230, in _process_next_batch
raise batch.exc_type(batch.exc_msg)
TypeError: Traceback (most recent call last):
File "/home/Software/anaconda3/envs/python-3.5/lib/python3.5/site-packages/torch/utils/data/dataloader.py", line 42, in _worker_loop
samples = collate_fn([dataset[i] for i in batch_indices])
File "/home/Software/anaconda3/envs/python-3.5/lib/python3.5/site-packages/torch/utils/data/dataloader.py", line 42, in
samples = collate_fn([dataset[i] for i in batch_indices])
File "/media/files/DeepGlobe-Road-original/data.py", line 125, in getitem
id = self.ids[index]
TypeError: 'map' object is not subscriptable
解决办法在data.py中将trainlist转为list,见下面第三行
class ImageFolder(data.Dataset):
def init(self, trainlist, root):
self.ids = list(trainlist)
self.loader = default_loader
self.root = root
2、我会继续尝试我自己的数据,等有结果了来回复。

from deepglobe-road-extraction-challenge.

zxshi avatar zxshi commented on July 20, 2024

我的数据中标签图片的位深度为8,deepglobe的是24,这会不会是导致错误的原因?

from deepglobe-road-extraction-challenge.

zlckanata avatar zlckanata commented on July 20, 2024

如果是用的自己的数据,命名格式很可能和deepglobe的不一样。
从你最开始报的那个错来看,应该是dataloader没有读取到数据列表,也就是train.py的21、22行的imagelist和trainlist都为空,建议你打印len(imagelist)和len(trainlist),应该都是0。
解决方法:建议修改train.py的21、22行,以及data.py的92、93行。
https://github.com/zlkanata/DeepGlobe-Road-Extraction-Challenge/blob/d274cdcb34eb93798f8ec17c7f5a200e70a2b969/train.py#L21-L22
https://github.com/zlkanata/DeepGlobe-Road-Extraction-Challenge/blob/d274cdcb34eb93798f8ec17c7f5a200e70a2b969/data.py#L92-L93

from deepglobe-road-extraction-challenge.

zxshi avatar zxshi commented on July 20, 2024

嗯嗯,谢谢大神。我把图片和标签重命名为deepglobe格式可以运行了。
标签位深度8和24没影响,位深度为8的话需要将背景设为0,另一个标签设为255才有效果(最开始我把背景设为0,标签设为1,用38张图像训练,测试结果全黑,用arcgis打开也是全黑)。
接下来我准备用大批数据进行实验,期待有好的结果。

from deepglobe-road-extraction-challenge.

zlckanata avatar zlckanata commented on July 20, 2024

不客气哈~
因为deepglobe给的标签中,背景是0,道路是255,所以读取标签后,除以了255做”归一化“。
https://github.com/zlkanata/DeepGlobe-Road-Extraction-Challenge/blob/d274cdcb34eb93798f8ec17c7f5a200e70a2b969/data.py#L111
祝有好的结果!

from deepglobe-road-extraction-challenge.

zxshi avatar zxshi commented on July 20, 2024

训练的时候没有使用验证集吗?我把验证集下载后发现只有sat没有标签,是这样吗?

from deepglobe-road-extraction-challenge.

zlckanata avatar zlckanata commented on July 20, 2024

官方没有给验证集的标签,需要将验证集的预测标签提交到官网,官方会给一个分数。

from deepglobe-road-extraction-challenge.

zxshi avatar zxshi commented on July 20, 2024

明白,感谢您的回复!

from deepglobe-road-extraction-challenge.

zxshi avatar zxshi commented on July 20, 2024

image
image

请问你知道为什么有的地方检测不到吗?
比如上面这种情况,大路检测到了,跨越大路由上延伸到下面的路检测到了一半。
问题1是:小路左侧还有一条路,完全检测不到,感觉不合理啊?
问题2是:检测到一半的这条路大佬能不能指点一下如何优化啊?
感谢大佬回复

from deepglobe-road-extraction-challenge.

zlckanata avatar zlckanata commented on July 20, 2024

关于你的问题一:这条道路完全检测不出来,就说明网络以比较高的置信度判断这不是要检测出来的道路,需要查看一下数据集中类似区域是否被标注为道路了。
关于你的问题二:检测到一半其实也是置信度不够高(例如在0.4~0.6之间),但是这里暴力二值化了,道路看起来就像是断了一样。可以对概率图使用crf之类的后处理来平滑整体的置信度,这一步需要小心处理;也可以对二值化后的图使用图算法做处理(参见 https://github.com/snakers4/spacenet-three 的后处理部分)。

from deepglobe-road-extraction-challenge.

zxshi avatar zxshi commented on July 20, 2024

非常感谢!

from deepglobe-road-extraction-challenge.

l53ma avatar l53ma commented on July 20, 2024

Hello, I have same question when running Python3 train.py, here is the error:

Traceback (most recent call last):
File "train.py", line 39, in
num_workers=4)
File "/home/ev1-ws4/anaconda3/lib/python3.5/site-packages/torch/utils/data/dataloader.py", line 176, in init
sampler = RandomSampler(dataset)
File "/home/ev1-ws4/anaconda3/lib/python3.5/site-packages/torch/utils/data/sampler.py", line 66, in init
"value, but got num_samples={}".format(self.num_samples))
ValueError: num_samples should be a positive integer value, but got num_samples=0

I output the length of "imagelist" and "trainlist", which is 6226 and 0, respectively.

imagelist = filter(lambda x: x.find('sat')!=-1, os.listdir(ROOT)) #length: 6226
trainlist = map(lambda x: x[:-8], imagelist) #length: 0
x = list(imagelist)
y = list(trainlist)
print(len(x), len(y))

Any ideas how to solve this problem? Many thanks.

from deepglobe-road-extraction-challenge.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.