Mask-RCNN,RasterioIOError

时间:2019-09-10 13:15:40

标签: python-3.x tensorflow keras mask faster-rcnn

我正在使用MaskRCNN,当我尝试训练我的数据集时,出现如下错误:

---------------------------------------------------------------------------
CPLE_OpenFailed                           Traceback (most recent call last)
rasterio/_base.pyx in rasterio._base.DatasetReader.start (rasterio/_base.c:2847)()

rasterio/_base.pyx in rasterio._base.DatasetReader.start (rasterio/_base.c:2799)()

rasterio/_err.pyx in rasterio._err.CPLErrors.check (rasterio/_err.c:1773)()

CPLE_OpenFailed: D:/DATASET/SpaceNet/Train/AOI_2_Vegas_Train/RGB-PanSharpen/RGB-PanSharpen_AOI_2_Vegas_img1189.tif: No such file or directory

During handling of the above exception, another exception occurred:

RasterioIOError                           Traceback (most recent call last)
<ipython-input-11-83fb3ae74319> in <module>
      6             learning_rate=config.LEARNING_RATE,
      7             epochs=1,
----> 8             layers='heads')

~\Desktop\SpaceNet_MaskRCNN\mrcnn\model.py in train(self, train_dataset, val_dataset, learning_rate, epochs, layers, augmentation, custom_callbacks, no_augmentation_sources)
   2372             max_queue_size=100,
   2373             workers=workers,
-> 2374             use_multiprocessing=True,
   2375         )
   2376         self.epoch = max(self.epoch, epochs)

~\Anaconda3\envs\MaskRCNN\lib\site-packages\keras\legacy\interfaces.py in wrapper(*args, **kwargs)
     89                 warnings.warn('Update your `' + object_name + '` call to the ' +
     90                               'Keras 2 API: ' + signature, stacklevel=2)
---> 91             return func(*args, **kwargs)
     92         wrapper._original_function = func
     93         return wrapper

~\Anaconda3\envs\MaskRCNN\lib\site-packages\keras\engine\training.py in fit_generator(self, generator, steps_per_epoch, epochs, verbose, callbacks, validation_data, validation_steps, validation_freq, class_weight, max_queue_size, workers, use_multiprocessing, shuffle, initial_epoch)
   1656             use_multiprocessing=use_multiprocessing,
   1657             shuffle=shuffle,
-> 1658             initial_epoch=initial_epoch)
   1659 
   1660     @interfaces.legacy_generator_methods_support

~\Anaconda3\envs\MaskRCNN\lib\site-packages\keras\engine\training_generator.py in fit_generator(model, generator, steps_per_epoch, epochs, verbose, callbacks, validation_data, validation_steps, validation_freq, class_weight, max_queue_size, workers, use_multiprocessing, shuffle, initial_epoch)
    179             batch_index = 0
    180             while steps_done < steps_per_epoch:
--> 181                 generator_output = next(output_generator)
    182 
    183                 if not hasattr(generator_output, '__len__'):

~\Desktop\SpaceNet_MaskRCNN\mrcnn\model.py in data_generator(dataset, config, shuffle, augment, augmentation, random_rois, batch_size, detection_targets, no_augmentation_sources)
   1707                     load_image_gt(dataset, config, image_id, augment=augment,
   1708                                 augmentation=augmentation,
-> 1709                                 use_mini_mask=config.USE_MINI_MASK)
   1710 
   1711             # Skip images that have no instances. This can happen in cases

~\Desktop\SpaceNet_MaskRCNN\mrcnn\model.py in load_image_gt(dataset, config, image_id, augment, augmentation, use_mini_mask)
   1209     """
   1210     # Load image and mask
-> 1211     image = dataset.load_image(image_id)
   1212     mask, class_ids = dataset.load_mask(image_id)
   1213     original_shape = image.shape

<ipython-input-6-e65486a11b62> in load_image(self, image_id)
     14         ResimAdi = str(ResimPATH)+'RGB-PanSharpen_AOI_2_Vegas_img'+str(image_id)+'.tif'
     15 
---> 16         with rasterio.open(ResimAdi,'r') as ds:
     17             arr = ds.read()
     18             image = reshape_as_image(arr)

~\Anaconda3\envs\MaskRCNN\lib\site-packages\rasterio\__init__.py in open(path, mode, driver, width, height, count, crs, transform, dtype, nodata, **kwargs)
    191         raise ValueError(
    192             "mode string must be one of 'r', 'r+', or 'w', not %s" % mode)
--> 193     s.start()
    194     return s
    195 

rasterio/_base.pyx in rasterio._base.DatasetReader.start (rasterio/_base.c:2969)()

RasterioIOError: D:/DATASET/SpaceNet/Train/AOI_2_Vegas_Train/RGB-PanSharpen/RGB-PanSharpen_AOI_2_Vegas_img1189.tif: No such file or directory

我知道,它说没有名称为

的目录/文件
  

D:/DATASET/SpaceNet/Train/AOI_2_Vegas_Train/RGB-PanSharpen/RGB-PanSharpen_AOI_2_Vegas_img1189.tif

但是问题是,图像ID(1189)image_id从未存在。

Tensorflow / Keras是否创建随机数而不是image_id?

0 个答案:

没有答案