用SegNet做裂缝识别,第一次epoch正常运行,第二次epoch刚开始就报错
这是报错内容
379/379 [==============================] - 2858s 8s/step - loss: 0.2259 - accuracy: 0.9275 - val_loss: 0.6390 - val_accuracy: 0.5219
Epoch 2/30
1/379 [..............................] - ETA: 1sTraceback (most recent call last):
File "D:\Anaconda\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow_core\python\keras\engine\training_v2.py", line 767, in on_epoch
yield epoch_logs
File "D:\Anaconda\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow_core\python\keras\engine\training_v2.py", line 342, in fit
total_epochs=epochs)
File "D:\Anaconda\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow_core\python\keras\engine\training_v2.py", line 128, in run_one_epoch
batch_outs = execution_function(iterator)
File "D:\Anaconda\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow_core\python\keras\engine\training_v2_utils.py", line 98, in execution_function
distributed_function(input_fn))
File "D:\Anaconda\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow_core\python\eager\def_function.py", line 568, in __call__
result = self._call(*args, **kwds)
File "D:\Anaconda\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow_core\python\eager\def_function.py", line 599, in _call
return self._stateless_fn(*args, **kwds) # pylint: disable=not-callable
File "D:\Anaconda\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow_core\python\eager\function.py", line 2363, in __call__
return graph_function._filtered_call(args, kwargs) # pylint: disable=protected-access
File "D:\Anaconda\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow_core\python\eager\function.py", line 1611, in _filtered_call
self.captured_inputs)
File "D:\Anaconda\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow_core\python\eager\function.py", line 1692, in _call_flat
ctx, args, cancellation_manager=cancellation_manager))
File "D:\Anaconda\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow_core\python\eager\function.py", line 545, in call
ctx=ctx)
File "D:\Anaconda\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow_core\python\eager\execute.py", line 67, in quick_execute
six.raise_from(core._status_to_exception(e.code, message), None)
File "<string>", line 3, in raise_from
tensorflow.python.framework.errors_impl.UnknownError: IndexError: list index out of range
Traceback (most recent call last):
File "D:\Anaconda\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow_core\python\ops\script_ops.py", line 236, in __call__
ret = func(*args)
File "D:\Anaconda\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow_core\python\data\ops\dataset_ops.py", line 789, in generator_py_func
values = next(generator_state.get_iterator(iterator_id))
File "C:\Users\Administrator\Desktop\python学习\SegNet\Semantic-segmentation-master\mySegNet\train+validation.py", line 134, in generate_arrays_from_file
train_x_name = lines[read_line].split(';')[0]
IndexError: list index out of range
[[{{node PyFunc}}]]
[[IteratorGetNext]] [Op:__inference_distributed_function_3148]
Function call stack:
distributed_function
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\Administrator\Desktop\python学习\SegNet\Semantic-segmentation-master\mySegNet\train+validation.py", line 221, in <module>
main()
File "C:\Users\Administrator\Desktop\python学习\SegNet\Semantic-segmentation-master\mySegNet\train+validation.py", line 208, in main
initial_epoch=0)
File "D:\Anaconda\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow_core\python\util\deprecation.py", line 324, in new_func
return func(*args, **kwargs)
File "D:\Anaconda\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow_core\python\keras\engine\training.py", line 1306, in fit_generator
initial_epoch=initial_epoch)
File "D:\Anaconda\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow_core\python\keras\engine\training.py", line 819, in fit
use_multiprocessing=use_multiprocessing)
File "D:\Anaconda\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow_core\python\keras\engine\training_v2.py", line 397, in fit
prefix='val_')
File "D:\Anaconda\Anaconda3\envs\tensorflow\lib\contextlib.py", line 130, in __exit__
self.gen.throw(type, value, traceback)
File "D:\Anaconda\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow_core\python\keras\engine\training_v2.py", line 771, in on_epoch
self.callbacks.on_epoch_end(epoch, epoch_logs)
File "D:\Anaconda\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow_core\python\keras\callbacks.py", line 302, in on_epoch_end
callback.on_epoch_end(epoch, logs)
File "D:\Anaconda\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow_core\python\keras\callbacks.py", line 992, in on_epoch_end
self._save_model(epoch=epoch, logs=logs)
File "D:\Anaconda\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow_core\python\keras\callbacks.py", line 1011, in _save_model
filepath = self._get_file_path(epoch, logs)
File "D:\Anaconda\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow_core\python\keras\callbacks.py", line 1055, in _get_file_path
return self.filepath.format(epoch=epoch + 1, **logs)
KeyError: 'loss'
Process finished with exit code 1