Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Could not find variable conv1/gdn_0/reparam_gamma

オープン
#187 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
python, tensorflow

調査の方向性

Start with the supplied my_model definition and reproduce the failure at model.fit using TensorFlow 2.8.0 and tensorflow-compression 2.8.0. Compare the model behavior with GDN removed or replaced, then inspect the GDN activation path and variable initialization. Done means the GDN-enabled model completes training without the missing reparam_gamma error.

索引モデルが issue の本文から書いたものです。

説明

Describe the bug
I am using tensorflow and tensorflow-compression to train a new model in keras. However, when the code runs to model.fit, the following error occurs:

Epoch 1/100
*** tensorflow.python.framework.errors_impl.FailedPreconditionError: 2 root error(s) found.
  (0) FAILED_PRECONDITION: Could not find variable conv1/gdn_0/reparam_gamma. This could mean that the variable has been deleted. In TF1, it can
also mean the variable is uninitialized. Debug info: container=localhost, status error message=Resource localhost/conv1/gdn_0/reparam_gamma/N10tensorflow3VarE does not exist.
         [[{{node conv1/gdn_0/gamma/lower_bound_1/ReadVariableOp}}]]
         [[loss/mul/_97]]
  (1) FAILED_PRECONDITION: Could not find variable conv1/gdn_0/reparam_gamma. This could mean that the variable has been deleted. In TF1, it can
also mean the variable is uninitialized. Debug info: container=localhost, status error message=Resource localhost/conv1/gdn_0/reparam_gamma/N10tensorflow3VarE does not exist.
         [[{{node conv1/gdn_0/gamma/lower_bound_1/ReadVariableOp}}]]
0 successful operations.
0 derived errors ignored.

This is my model:

import tensorflow as tf
from tensorflow import keras
from tensorflow.keras.models import Model
from tensorflow.keras.layers import Conv2D
from tensorflow.keras.layers import LeakyReLU
from tensorflow.keras.layers import Input
from tensorflow_compression import GDN

def my_model:
    def __init__(self,input_shape,filter_num):
        self.input_shape = input_shape
        self.filter_num = filter_num
    def create_model(self):
        input = Input(shape=self.input_shape, name="input_1")
        conv1 = Conv2D(filters=self.filter_num, kernel_size=3, padding="same", name="conv1", activation=GDN(name="gdn_0"))
        x = conv1(input)
        # layer_gdn = GDN(name="gdn_0")
        # x = layer_gdn(x)
        output  = LeakyReLU(alpha=self.alpha, name="hidden_activation")(x)
        model = Model(inputs=input, outputs=output)
        if self.training:
            opt = keras.optimizers.Adam()
            model.compile(
                optimizer=opt,
                loss=MSELoss,
                experimental_run_tf_function=False,
            )
        return model

Besides, if I remove the activation=GDN(name="gdn_0") or replace it with others, the training goes well, so maybe it is a bug.
What should I do to solve it?

Thanks.

System:

  • OS: Ubuntu18.04
  • Python version: 3.8, [anaconda install]
  • TensorFlow version 2.8.0 [pip install]
  • tensorflow-compression version 2.8.0
主要言語
Python
スター
923
フォーク
258
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

tensorflow/compression のほかの issue

tensorflow/compression の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。