実現したいこと
kaggleのコンペのルールでインターネットをOFFの状態で実行しなければいけません。
作成したモデルが自動でインターネットに接続されアプリをダウンロードする仕組みのようで、そこで止まってしまいます。
該当のソースコード
keras.backend.clear_session() with strategy.scope(): model = keras.Sequential( [ keras.layers.InputLayer(input_shape=INP_SIZE+(3,)), data_preprocessing, data_augmentations, applications.EfficientNetB0(include_top=False, pooling='avg'), keras.layers.Dense(1, activation=None, dtype='float32') ] ) model.compile( optimizer = tfa.optimizers.RectifiedAdam(learning_rate=0.003, amsgrad=False), loss = binary_focal_loss( apply_class_balancing=True, apply_bce_weight=5, alpha=0.75, gamma=7.0, label_smoothing=0.05, from_logits=True, reduction='mean' ), metrics = [ tf_pfbeta(beta=1.0, from_logits=True), tf_auc(from_logits=True), ] ) model.summary()
発生している問題・エラーメッセージ
ファイルをダウンロードしようとして失敗しています。
Downloading data from https://storage.googleapis.com/keras-applications/efficientnetb0_notop.h5 ~~~~ gaierror Traceback (most recent call last) . . gaierror: [Errno -3] Temporary failure in name resolution During handling of the above exception, another exception occurred: URLError Traceback (most recent call last) . . URLError: <urlopen error [Errno -3] Temporary failure in name resolution> During handling of the above exception, another exception occurred: Exception Traceback (most recent call last) . . Exception: URL fetch failure on https://storage.googleapis.com/keras-applications/efficientnetb0_notop.h5: None -- [Errno -3] Temporary failure in name resolution
試したこと
一旦オンラインで,
https://storage.googleapis.com/keras-applications/efficientnetb0_notop.h5 のファイルをダウンロードしてオフラインでinstallしようとしましたがエラーになります。
!pip install /kaggle/input/efficientnetb0-notop/efficientnetb0_notop.h5
ERROR: Invalid requirement: '/kaggle/input/efficientnetb0-notop/efficientnetb0_notop.h5' Hint: It looks like a path. The path does exist. The argument you provided (/kaggle/input/efficientnetb0-notop/efficientnetb0_notop.h5) appears to be a requirements file. If that is the case, use the '-r' flag to install the packages specified within it.
!pip install -r /kaggle/input/efficientnetb0-notop/efficientnetb0_notop.h5
ERROR: Exception: Traceback (most recent call last): UnicodeDecodeError: 'utf-8' codec can't decode byte 0x89 in position 0: invalid start byte
補足情報(FW/ツールのバージョンなど)
このコードはオンラインでは動きます。
回答1件
あなたの回答
tips
プレビュー