ImageAI-“ TypeError:'NoneType'对象不可下标”

时间:2019-12-22 18:34:43

标签: python tensorflow neural-network object-detection imageai

在第一个时代839/840的ImageAI中使用DetectModelTrainer()类时,出现此错误:

libpng warning: iCCP: known incorrect sRGB profile
Cannot find  crab\validation\images\533.257297283.jpg
Traceback (most recent call last):
  File "train.py", line 7, in <module>
    trainer.trainModel()
  File "C:\Users\cl\AppData\Local\Programs\Python\Python36\lib\site-packages\imageai\Detection\Custom\__init__.py", line 291, in trainModel
    max_queue_size=8
  File "C:\Users\cl\AppData\Local\Programs\Python\Python36\lib\site-packages\keras\legacy\interfaces.py", line 91, in wrapper
    return func(*args, **kwargs)
  File "C:\Users\cl\AppData\Local\Programs\Python\Python36\lib\site-packages\keras\engine\training.py", line 1732, in fit_generator
    initial_epoch=initial_epoch)
  File "C:\Users\cl\AppData\Local\Programs\Python\Python36\lib\site-packages\keras\engine\training_generator.py", line 242, in fit_generator
    workers=0)
  File "C:\Users\cl\AppData\Local\Programs\Python\Python36\lib\site-packages\keras\legacy\interfaces.py", line 91, in wrapper
    return func(*args, **kwargs)
  File "C:\Users\cl\AppData\Local\Programs\Python\Python36\lib\site-packages\keras\engine\training.py", line 1791, in evaluate_generator
    verbose=verbose)
  File "C:\Users\cl\AppData\Local\Programs\Python\Python36\lib\site-packages\keras\engine\training_generator.py", line 365, in evaluate_generator
    generator_output = next(output_generator)
  File "C:\Users\cl\AppData\Local\Programs\Python\Python36\lib\site-packages\keras\utils\data_utils.py", line 625, in get
    six.reraise(*sys.exc_info())
  File "C:\Users\cl\AppData\Local\Programs\Python\Python36\lib\site-packages\six.py", line 696, in reraise
    raise value
  File "C:\Users\cl\AppData\Local\Programs\Python\Python36\lib\site-packages\keras\utils\data_utils.py", line 610, in get
    inputs = future.get(timeout=30)
  File "C:\Users\cl\AppData\Local\Programs\Python\Python36\lib\multiprocessing\pool.py", line 644, in get
    raise self._value
  File "C:\Users\cl\AppData\Local\Programs\Python\Python36\lib\multiprocessing\pool.py", line 119, in worker
    result = (True, func(*args, **kwds))
  File "C:\Users\cl\AppData\Local\Programs\Python\Python36\lib\site-packages\keras\utils\data_utils.py", line 406, in get_index
    return _SHARED_SEQUENCES[uid][i]
  File "C:\Users\cl\AppData\Local\Programs\Python\Python36\lib\site-packages\imageai\Detection\Custom\generator.py", line 73, in __getitem__
    img, all_objs = self._aug_image(train_instance, net_h, net_w)
  File "C:\Users\cl\AppData\Local\Programs\Python\Python36\lib\site-packages\imageai\Detection\Custom\generator.py", line 163, in _aug_image
    image = image[:,:,::-1] # RGB image
TypeError: 'NoneType' object is not subscriptable

这仅仅是因为它找不到该图像吗?或者是别的什么?我只是想知道,因为要花很长时间才能用找到的图像测试错误。

错误发生后还有什么方法可以从同一位置继续进行?

谢谢

0 个答案:

没有答案