Comments (13)
应该是数据的问题,建议检查一下 "dataset/train/" 这个文件夹下的数据,如果你把deepglobe的训练数据解压在这里,应该直接就能运行起来。
from deepglobe-road-extraction-challenge.
好的,谢谢!
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.
我的数据中标签图片的位深度为8,deepglobe的是24,这会不会是导致错误的原因?
from deepglobe-road-extraction-challenge.
如果是用的自己的数据,命名格式很可能和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.
嗯嗯,谢谢大神。我把图片和标签重命名为deepglobe格式可以运行了。
标签位深度8和24没影响,位深度为8的话需要将背景设为0,另一个标签设为255才有效果(最开始我把背景设为0,标签设为1,用38张图像训练,测试结果全黑,用arcgis打开也是全黑)。
接下来我准备用大批数据进行实验,期待有好的结果。
from deepglobe-road-extraction-challenge.
不客气哈~
因为deepglobe给的标签中,背景是0,道路是255,所以读取标签后,除以了255做”归一化“。
https://github.com/zlkanata/DeepGlobe-Road-Extraction-Challenge/blob/d274cdcb34eb93798f8ec17c7f5a200e70a2b969/data.py#L111
祝有好的结果!
from deepglobe-road-extraction-challenge.
训练的时候没有使用验证集吗?我把验证集下载后发现只有sat没有标签,是这样吗?
from deepglobe-road-extraction-challenge.
官方没有给验证集的标签,需要将验证集的预测标签提交到官网,官方会给一个分数。
from deepglobe-road-extraction-challenge.
明白,感谢您的回复!
from deepglobe-road-extraction-challenge.
请问你知道为什么有的地方检测不到吗?
比如上面这种情况,大路检测到了,跨越大路由上延伸到下面的路检测到了一半。
问题1是:小路左侧还有一条路,完全检测不到,感觉不合理啊?
问题2是:检测到一半的这条路大佬能不能指点一下如何优化啊?
感谢大佬回复
from deepglobe-road-extraction-challenge.
关于你的问题一:这条道路完全检测不出来,就说明网络以比较高的置信度判断这不是要检测出来的道路,需要查看一下数据集中类似区域是否被标注为道路了。
关于你的问题二:检测到一半其实也是置信度不够高(例如在0.4~0.6之间),但是这里暴力二值化了,道路看起来就像是断了一样。可以对概率图使用crf之类的后处理来平滑整体的置信度,这一步需要小心处理;也可以对二值化后的图使用图算法做处理(参见 https://github.com/snakers4/spacenet-three 的后处理部分)。
from deepglobe-road-extraction-challenge.
非常感谢!
from deepglobe-road-extraction-challenge.
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)
- Licensing Terms HOT 1
- Multi class segmentation HOT 2
- 看到个道路提取的专利也叫dlinknet HOT 1
- Error when I run train.py HOT 1
- TypeError: new(): argument 'size' must be tuple of ints, but found element of type float at pos 2 HOT 1
- i got a problem :ValueError: num_samples should be a positive integer value, but got num_samples=0
- 代码不能跑 HOT 1
- 数据归一化时的处理(//255 * 3.2 - 1.6) HOT 2
- 关于数据集
- 希望借用codalab账号
- 希望借用codalab账号 HOT 2
- unet预测全黑 HOT 2
- test.py HOT 1
- 多GPU训练模型 HOT 1
- Error: axis 2 is out of bounds for array of dimension 1
- 您好在吗打扰一下您这个程序是哪里需要改动就能使用的,还是能直接使用
- init
- 使用其他数据集进行训练如何修改代码?
- Error: The size of tensor a (376) must match the size of tensor b (375) at non-singleton dimension 3
- mask[mask > XX] = 255, mask[mask <=XX] = 0, is the value of XX an experience value? Does the XX threshold need to be set differently for different graphs? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from deepglobe-road-extraction-challenge.