LoginSignup
6
1

More than 1 year has passed since last update.

【重要】Google colabでgdown使用時のエラー

Last updated at Posted at 2022-02-19

1.はじめに

  ディープラーニングの学習済みパラメータなど大容量のファイルをダウンロードするときに、該当ファイルを google drive に保存しておき、共有リンクを使って gdown でダウンロードする手法がよく使われます。
 しかし、google colabではこの手法が、2022.2.17頃から正常に動作しなくなり、下記のようなエラーが発生しています。
 最近は、githubに掲載されているリポジトリの多くはgoogle colabの形式でも提供されていて、それらがgdownを使っていると全て影響を受けていると思われます。

Access denied with the following error:
    Cannot retrieve the public link of the file. You may need to change
    the permission to 'Anyone with the link', or have had many accesses. 
You may still be able to access the file from the browser:
     https://drive.google.com/uc?id=1Yr7KuD959btpmcKGAUsbAk5rPjX2MytK 

 

2.対策

import gdown の前に、下記コマンドを追加します。これによって、google colabに最新バージョンのgdownがインストールされ、gdownが正常に動作します。

! pip install --upgrade gdown

3.推定原因

 googleがgoogle driveのダンロードに関して何らかの仕様変更を行なったために、google colabにインストール済みのgdownのバージョンとの互換性がなくなったと思われます。
 google colabにインストールされているgdownを早く最新版にして欲しいところです。googleさん、よろしく!

6
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
1