End-to-end-CD-for-VHR-satellite-image
End-to-end-CD-for-VHR-satellite-image copied to clipboard
run error
when I run the code,I got the error,how can I solve it?
Traceback (most recent call last):
File "UNet++_MSOF_model.py", line 226, in
[[1., 1., 1.],
[1., 1., 1.],...
This is how I organize the data:
def generateData(batch_size,data=[]):
#print 'generateData...'
while True:
train_data = []
train_label = []
batch = 0
for i in (range(len(data))):
url1 = data[i]
batch += 1
img=np.load(filepath1 + 'combine/' + url1)
img = np.array(img,dtype="float")#/255.0
img = (img-np.min(img))/(np.max(img)-np.min(img))
img = img_to_array(img)
train_data.append(img)
label = np.load(filepath1 + 'label/' + url1)
label =np.array(label,dtype='float')/255.0
# 做一个阈值处理,输出的概率值大于0.5的就认为是对象,否则认为是背景
label[label > 0.5] = 1
label[label <= 0.5] = 0
label = img_to_array(label)
train_label.append(label)
print('a',batch)
if batch % batch_size==0:
#print 'get enough bacth!\n'
train_data = np.array(train_data)
train_label = np.array(train_label)
yield (train_data,train_label)
train_data = []
train_label = []
batch = 0
return train_data,train_label
and then i use the fit_generator to train it,are you know where is my wrong?
Hi, all your input to the net should be 4-D tensor (Batchsize, W,H,C), maybe your input of 'train_label' is not.
Hi, all your input to the net should be 4-D tensor (Batchsize, W,H,C), maybe your input of 'train_label' is not.
Hi, i'm learning your paper and code of this repository. I have two questions:
- When infer an image, the output tensor shape of the network is [batch_size, 256, 256 5] or [batch_size, 256, 256, 1] ? When i did inference, i got a output of [1, 256, 256, 1] but the model's output=[nestnet_output_1, nestnet_output_2, nestnet_output_3, nestnet_output_4, nestnet_output_5]. I am not sure whether i misunderstand the network or not.
- How did you make data augmentation described in your paper? Could you share your code about it? Thank you !