【问题标题】:In Google collab I get IOPub data rate exceeded在 Google 协作中,我得到了 IOPub 数据速率超出
【发布时间】:2018-11-14 07:58:26
【问题描述】:

已超出 IOPub 数据速率。 笔记本服务器将暂时停止发送输出 给客户端,以避免崩溃。 要更改此限制,请设置配置变量 --NotebookApp.iopub_data_rate_limit.

当前值:

NotebookApp.iopub_data_rate_limit=1000000.0 (bytes/sec)
NotebookApp.rate_limit_window=3.0 (secs)

【问题讨论】:

  • 你有什么问题?

标签: google-colaboratory


【解决方案1】:
%cd darknet
!sed -i 's/OPENCV=0/OPENCV=1/' Makefile
!sed -i 's/GPU=0/GPU=1/' Makefile
!sed -i 's/CUDNN=0/CUDNN=1/' Makefile
!sed -i 's/CUDNN_HALF=0/CUDNN_HALF=1/' Makefile
!apt update
!apt-get install libopencv-dev

更新你的make文件很重要。另外,请保持输入文件名正确

【讨论】:

    【解决方案2】:

    也许这会有所帮助..

    来自通过 sv1997

    IOPub Error on Google Colaboratory in Jupyter Notebook

    IoPub Error is occurring in Colab because you are trying to display the output on the console itself(Eg. print() statements) which is very large.
    

    IoPub 错误可能与打印功能有关。

    所以删除或注释打印功能。它可能会解决错误。

    【讨论】:

      【解决方案3】:

      当您尝试将大量数据打印到控制台时,通常会发生 IOPub 错误。检查您的打印语句 - 如果您尝试打印超过 10MB 的文件,这很可能是导致错误的原因。尝试读取文件/数据的较小部分。

      我在将文件从 Google Drive 读取到 Colab 时遇到了这个问题。 我用这个链接https://colab.research.google.com/notebook#fileId=/v2/external/notebooks/io.ipynb 问题出在这段代码中

      # Download the file we just uploaded.
      #
      # Replace the assignment below with your file ID
      # to download a different file.
      #
      # A file ID looks like: 1uBtlaggVyWshwcyP6kEI-y_W3P8D26sz
      file_id = 'target_file_id'
      
      import io
      from googleapiclient.http import MediaIoBaseDownload
      
      request = drive_service.files().get_media(fileId=file_id)
      downloaded = io.BytesIO()
      downloader = MediaIoBaseDownload(downloaded, request)
      done = False
      while done is False:
        # _ is a placeholder for a progress object that we ignore.
        # (Our file is small, so we skip reporting progress.)
        _, done = downloader.next_chunk()
      
      downloaded.seek(0)
      
      #Remove this print statement
      #print('Downloaded file contents are: {}'.format(downloaded.read()))
      

      我不得不删除最后一个打印语句,因为它超过了笔记本中的 10MB 限制 - print('Downloaded file contents are: {}'.format(downloaded.read()))
      您的文件仍将被下载,您可以以较小的块读取它或读取文件的一部分。

      【讨论】:

        【解决方案4】:

        上面的答案是正确的,我只是评论了打印语句,错误就消失了。只是把它放在这里,这样有人可能会觉得它有用。假设你正在从谷歌驱动器读取一个 csv 文件,只需导入 pandas 并添加 pd.read_csv(downloaded) 就可以了。

        file_id = 'FILEID'
        
        import io
        from googleapiclient.http import MediaIoBaseDownload
        
        request = drive_service.files().get_media(fileId=file_id)
        downloaded = io.BytesIO()
        downloader = MediaIoBaseDownload(downloaded, request)
        done = False
        while done is False:
          # _ is a placeholder for a progress object that we ignore.
          # (Our file is small, so we skip reporting progress.)
          _, done = downloader.next_chunk()
        
        downloaded.seek(0)
        pd.read_csv(downloaded);
        

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 2018-06-23
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2023-04-10
          • 2017-10-21
          • 2023-03-08
          • 2017-09-03
          相关资源
          最近更新 更多