OSError:[Errno 95] 不支持操作:Google Colab 上的“/content/drive/Mask_RCNN”

Joh*_*rer 4 google-colaboratory

您好,尝试在 colab 中使用 Mask RCNN 模型保存的权重,但不断出现以下错误消息。我尝试了不同的方法来解决 .h5 问题,这以前是一个问题,但现在我遇到了困难。我尝试过训练模型的不同部分,但没有效果。谷歌 Colab 上没有针对这些情况提供任何具体信息。以下是引发问题的单元格:

    # Training dataset.
    dataset_train = linkedinDataset()
    dataset_train.load_dataset(dataset_dir, "train")
    dataset_train.prepare()

    # Validation dataset
    dataset_val = linkedinDataset()
    dataset_val.load_dataset(dataset_dir, "val")
    dataset_val.prepare()

    # *** This training schedule is an example. Update to your needs ***
# 
#  
#  
    print("Training network heads")
    model.train(dataset_train,
                dataset_val,
                learning_rate=config.LEARNING_RATE,
                epochs=5,
                layers='heads')```



```Training network heads
    ---------------------------------------------------------------------------
    OSError                                   Traceback (most recent call last)
    <ipython-input-19-174a93609e58> in <module>()
       17             learning_rate=config.LEARNING_RATE,
     18             epochs=5,
---> 19             layers='heads')

  2 frames
   /content/Mask_RCNN/mrcnn/model.py in train(self, train_dataset, val_dataset, learning_rate, epochs, 
   layers, augmentation, custom_callbacks, no_augmentation_sources)
   2334         # Create log_dir if it does not exist
   2335         if not os.path.exists(self.log_dir):
  -> 2336             os.makedirs(self.log_dir)
   2337 
   2338         # Callbacks

    /usr/lib/python3.6/os.py in makedirs(name, mode, exist_ok)
    208     if head and tail and not path.exists(head):
    209         try:
    --> 210             makedirs(head, mode, exist_ok)
    211         except FileExistsError:
    212             # Defeats race condition when another thread created the path

    /usr/lib/python3.6/os.py in makedirs(name, mode, exist_ok)
    218             return
    219     try:
   --> 220         mkdir(name, mode)
    221     except OSError:
    222         # Cannot rely on checking for EEXIST, since the operating system

    OSError: [Errno 95] Operation not supported: '/content/drive/Mask_RCNN'```
Run Code Online (Sandbox Code Playgroud)

Kor*_*ich 9

你不能使用

'/content/drive/Mask_RCNN'
Run Code Online (Sandbox Code Playgroud)

您应该保存到

'/content/Mask_RCNN'
Run Code Online (Sandbox Code Playgroud)

或者,如果要使用 Google 云端硬盘,

'/content/drive/MyDrive/Mask_RCNN'
Run Code Online (Sandbox Code Playgroud)