bubbliiiing / Semantic-Segmentation

I will upload many semantic segmentation models to this repository for you to learn
MIT License
432 stars 158 forks source link

IndexError: index 2 is out of bounds for axis 0 with size 2 #20

Open KevinR10 opened 2 years ago

KevinR10 commented 2 years ago

您好,我在运行Unet-Mobile网络中的train.py文件时出现如下报错,请问您知道时什么原因嘛

Deprecated in favor of operator or tf.math.divide.
Epoch 1/50
Traceback (most recent call last):
  File "E:/Graduation_Project/Unet/train.py", line 126, in <module>
    callbacks=[checkpoint, reduce_lr, early_stopping])
  File "D:\Anaconda3\envs\test\lib\site-packages\keras\legacy\interfaces.py", line 91, in wrapper
    return func(*args, **kwargs)
  File "D:\Anaconda3\envs\test\lib\site-packages\keras\engine\training.py", line 2192, in fit_generator
    generator_output = next(output_generator)
  File "D:\Anaconda3\envs\test\lib\site-packages\keras\utils\data_utils.py", line 793, in get
    six.reraise(value.__class__, value, value.__traceback__)
  File "D:\Anaconda3\envs\test\lib\site-packages\six.py", line 703, in reraise
    raise value
  File "D:\Anaconda3\envs\test\lib\site-packages\keras\utils\data_utils.py", line 658, in _data_generator_task
    generator_output = next(self._generator)
  File "E:/Graduation_Project/Unet/train.py", line 42, in generate_arrays_from_file
    one_hot_label = np.eye(NCLASSES)[np.array(label, np.int32)]
IndexError: index 2 is out of bounds for axis 0 with size 2

Process finished with exit code 1
bubbliiiing commented 2 years ago

emm,这个库这么老了,用新的把

KevinR10 commented 2 years ago

emm,这个库这么老了,用新的把

好的收到,感谢回复