title: ERROR: blob.download_to_filename, return an empty file and raise error
body: <p>I'm trying to download the *.tflite model on Google Cloud Storage to my Rapberry Pi 3B+ using the code as follows:</p>
  <pre class="lang-py prettyprint-override"><code>export_metadata = response.metadata
  export_directory = export_metadata.export_model_details.output_info.gcs_output_directory
  
  model_dir_remote = export_directory + remote_model_filename # file path on Google Cloud Storage
  model_dir = os.path.join(&quot;models&quot;, model_filename) # file path supposed to store locally
  
  blob = bucket.blob(model_dir_remote)
  blob.download_to_filename(model_dir)
  </code></pre>
  <p>However, this returns an empty file in my target directory locally, and meanwhile, raise an error:</p>
  <pre><code># ERROR: google.resumable_media.common.InvalidResponse: ('Request failed with status code', 404, 
  # 'Expected one of', &lt;HTTPStatus.OK: 200&gt;, &lt;HTTPStatus.PARTIAL_CONTENT: 206&gt;)
  
  # ERROR: google.api_core.exceptions.NotFound: 404 
  # GET https://storage.googleapis.com/download/storage/v1/b/ao-example/o/
  # gs%3A%2F%2Fao-example%2Fmodel-export%2Ficn%2Fedgetpu_tflite-Test_Model12-2020-11-16T07%3A54%3A27.187Z%2Fedgetpu_model.tflite?alt=media: 
  # ('Request failed with status code', 404, 'Expected one of', &lt;HTTPStatus.OK: 200&gt;, &lt;HTTPStatus.PARTIAL_CONTENT: 206&gt;)
  </code></pre>
  <p>I guaranteed the corresponding authority to the service account. What confuses me is that when I use <code>gsutil</code> command, it works:</p>
  <pre><code>gsutil cp gs://ao-example/model-export/icn/edgetpu_model.tflite models/
  </code></pre>
  <p>Is anyone encountering the same problem? Is there any error in my code? Your help will be greatly appreciated!</p>
  <hr />
  <p>I used the following code:</p>
  <pre class="lang-py prettyprint-override"><code>from google.cloud import storage
  from google.cloud import automl
  from google.cloud.storage import Blob
  
  client = storage.Client(project=&quot;semesterproject-294707&quot;)
  bucket_name = 'ao-example'
  bucket = client.get_bucket(bucket_name)
  
  model_dir_remote = &quot;gs://ao-example/model-export/icn/edgetpu_tflite-Test_Model13-2020-11-18T15:03:42.620Z/edgetpu_model.tflite&quot;
  
  blob = Blob(model_dir_remote, bucket)
  
  with open(&quot;models/edgetpu_model13.tflite&quot;, &quot;wb&quot;) as file_obj:
          blob.download_to_file(file_obj)
  </code></pre>
  <p>This raises the same error, and return an empty file also... Still, I can use <code>gsutil cp</code> command to download the file...</p>
  <hr />
  <p>(Edited on 06/12/2020)
  The info of model generated:</p>
  <pre><code>export_model_details {
    output_info {
      gcs_output_directory: &quot;gs://ao-example/model-export/icn/edgetpu_tflite-gc14-2020-12-06T14:43:18.772911Z/&quot;
    }
  }
  
  model_gcs_path: 'gs://ao-example/model-export/icn/edgetpu_tflite-gc14-2020-12-06T14:43:18.772911Z/edgetpu_model.tflite'
  
  model_local_path: 'models/edgetpu_model.tflite'
  </code></pre>
  <p>It still encounters the error:</p>
  <pre><code>google.api_core.exceptions.NotFound: 404 GET https://storage.googleapis.com/download/storage/v1/b/ao-example/o/gs%3A%2F%2Fao-example%2Fmodel-export%2Ficn%2Fedgetpu_tflite-gc14-2020-12-06T14%3A43%3A18.772911Z%2Fedgetpu_model.tflite?alt=media: ('Request failed with status code', 404, 'Expected one of', &lt;HTTPStatus.OK: 200&gt;, &lt;HTTPStatus.PARTIAL_CONTENT: 206&gt;)
  </code></pre>
  <p>Still, when I use <code>gsutil cp</code> command, it works:</p>
  <pre><code>gsutil cp model_gcs_path model_local_path
  </code></pre>
  <hr />
  <p>Edited on 12/12/2020</p>
  <p>Soni Sol's method works! Thanks!!</p>