在跑ENet的时候,遇到这个问题:
Traceback (most recent call last):
File "C:/Users/eren.luo/PycharmProjects/ENetbylxb/Netbyother/Keras-Semantic-Segmentation/train.py", line 186, in <module>
history = parallel_model.fit_generator(train_ge,
File "C:\Users\eren.luo\Miniconda3\envs\ENetbylxb\lib\site-packages\keras\engine\training.py", line 1975, in fit_generator
return self.fit(
File "C:\Users\eren.luo\Miniconda3\envs\ENetbylxb\lib\site-packages\keras\engine\training.py", line 1202, in fit
self._eval_data_handler = data_adapter.get_data_handler(
File "C:\Users\eren.luo\Miniconda3\envs\ENetbylxb\lib\site-packages\keras\engine\data_adapter.py", line 1383, in get_data_handler
return DataHandler(*args, **kwargs)
File "C:\Users\eren.luo\Miniconda3\envs\ENetbylxb\lib\site-packages\keras\engine\data_adapter.py", line 1138, in __init__
self._adapter = adapter_cls(
File "C:\Users\eren.luo\Miniconda3\envs\ENetbylxb\lib\site-packages\keras\engine\data_adapter.py", line 794, in __init__
peek, x = self._peek_and_restore(x)
File "C:\Users\eren.luo\Miniconda3\envs\ENetbylxb\lib\site-packages\keras\engine\data_adapter.py", line 851, in _peek_and_restore
peek = next(x)
RuntimeError: generator raised StopIteration
2022-05-05 11:09:43.314586: W tensorflow/core/kernels/data/generator_dataset_op.cc:107] Error occurred when finalizing GeneratorDataset iterator: Failed precondition: Python interpreter state is not initialized. The process may be terminated.
[[{{node PyFunc}}]]
解决办法: 下面的val_images 和val_segs 路径不存在,改为正确的路径就可以了。
val_images = os.path.join(data_root, "val_image")
val_segs = os.path.join(data_root, "val_label")
|