We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
源码: def generateData(batch_size,data=[]): #print 'generateData...' while True: train_data = [] train_label = [] batch = 0 for i in (range(len(data))): url = data[i] batch += 1 img = load_img(filepath + 'src/' + url) img = img_to_array(img) train_data.append(img) label = load_img(filepath + 'label/' + url, grayscale=True) label = img_to_array(label).reshape((img_w*img_h,)) print(label.shape) train_label.append(label)
报错: File "E:\RiseFile\Deeplearning\Satellite-Segmentation-master\segnet\segnet_train.py", line 78, in generateData label = img_to_array(label).reshape((img_w*img_h,)) ValueError: cannot reshape array of size 9907170 into shape (65536,) img_to_array后无法reshape,是不是写错了?在windows下运行的,请问如何解决?
The text was updated successfully, but these errors were encountered:
可以复现的,你这个估计是导错图片了,这个错误是大小不匹配。 你在file填写的地址应该是256*256这个切割后大小的图片,而不是原始图片。
Sorry, something went wrong.
No branches or pull requests
源码:
def generateData(batch_size,data=[]):
#print 'generateData...'
while True:
train_data = []
train_label = []
batch = 0
for i in (range(len(data))):
url = data[i]
batch += 1
img = load_img(filepath + 'src/' + url)
img = img_to_array(img)
train_data.append(img)
label = load_img(filepath + 'label/' + url, grayscale=True)
label = img_to_array(label).reshape((img_w*img_h,))
print(label.shape)
train_label.append(label)
The text was updated successfully, but these errors were encountered: