title: Importing Keras models into Colaboratory from Google Drive
body: <p>I am trying to find method to load a Keras model saved in .h5 format which is stored in Google Drive directly into a Colaboratory worksheet for use as a Keras model (without downloading to desktop first, already have method for that).</p>
  
  <p>I have succeeded in loading the .h5 file using the Colaboratory tutorials for Drive REST API:</p>
  
  <pre><code># Download the '.h5' file from google drive
  
  file_id = '1uBtlaggVyWshwcyP6kEI-y_W3P8D26sz'
  
  import io
  from io import BytesIO   
  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:
    status, done = downloader.next_chunk()
    if status:
        print("Download %%%d%%." % int(status.progress() * 100))
    print("Download Complete!")
  
  downloaded.seek(0)
  
  print('Downloaded file contents are: {}'.format(downloaded.read()))
  </code></pre>
  
  <p>Which outputs:</p>
  
  <pre><code>Download %100%.
  Download Complete!
  Downloaded file contents are: b'\x89HDF\r\n\x1a\n\x00\x00\x00...(etc)
  </code></pre>
  
  <p>And it appears that downloaded.read() gives a kind of byte string.</p>
  
  <p>My question is how can I then convert this byte string into a .h5 form so I can then call load_model from Keras? </p>