Open 03053020ITE opened 5 years ago
有解决了吗
I seems to be related to this known issue:
I changed the generator function in the utils directory to:
def generator(root_path, path_file, batch_size, n_classes, input_height, input_width, train=True): f = open(path_file, 'r') items = f.readlines() f.close() while True: # <== Move forever loop if train: shuffled_items = [] index = [n for n in range(len(items))] random.shuffle(index) for i in range(len(items)): shuffled_items.append(items[index[i]]) for j in range(len(items) // batch_size): x, y = get_batch(shuffled_items[j batch_size:(j + 1) batch_size], root_path, n_classes, input_height, input_width) yield np.array(x), np.array(y) else: for j in range(len(items) // batch_size): x, y = get_batch(items[j batch_size:(j + 1) batch_size], root_path, n_classes, input_height, input_width) yield np.array(x), np.array(y)
And it allowed my to train ok.
您好,你现在运行好了吗,我想和您交流一下,我现在也出现了类似的问题
@TianzhongSong 你好,请教一下一个问题 首先我已经照着list格式放置好了dataset和label,为何我下了指令python train_segmentation.py --model='unet' 停止在epoch(1/50) 再麻烦您回复了 万分感谢