Raja
Raja

Reputation: 231

In Google collab I get IOPub data rate exceeded

IOPub data rate exceeded. The notebook server will temporarily stop sending output to the client in order to avoid crashing it. To change this limit, set the config variable --NotebookApp.iopub_data_rate_limit.

Current values:

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

Upvotes: 21

Views: 60332

Answers (4)

Srishti
Srishti

Reputation: 436

An IOPub error usually occurs when you try to print a large amount of data to the console. Check your print statements - if you're trying to print a file that exceeds 10MB, its likely that this caused the error. Try to read smaller portions of the file/data.

I faced this issue while reading a file from Google Drive to Colab. I used this link https://colab.research.google.com/notebook#fileId=/v2/external/notebooks/io.ipynb and the problem was in this block of code

    # 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()))

I had to remove the last print statement since it exceeded the 10MB limit in the notebook - print('Downloaded file contents are: {}'.format(downloaded.read()))
Your file will still be downloaded and you can read it in smaller chunks or read a portion of the file.

Upvotes: 21

TDI-India
TDI-India

Reputation: 37

%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

its important to update your make file. and also, keep your input file name correct

Upvotes: -2

DIGMASTER97
DIGMASTER97

Reputation: 329

Maybe this will help..

from via 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.

The IoPub Error maybe related in print function.

So delete or annotate the print function. It may resolve the error.

Upvotes: 1

Abhishek Tripathi
Abhishek Tripathi

Reputation: 165

The above answer is correct, I just commented the print statement and the error went away. just keeping it here so someone might find it useful. Suppose u are reading a csv file from google drive just import pandas and add pd.read_csv(downloaded) it will work just fine.

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);

Upvotes: 2

Related Questions