LoginSignup
katsuki5080
@katsuki5080

Are you sure you want to delete the question?

Leaving a resolved question undeleted may help others!

AttributeError: module 'tensorflow' has no attribute 'contrib' エラーの直し方を教えてください

pythonで機械学習のGANを試しているのですが、以下のエラーが出ます。
環境はtensorflow-gpu==2.4.4を使っています。

AttributeError: module 'tensorflow' has no attribute 'contrib'

改善方法を調べて、いろいろ試しました。

import tensorflow.compat.v1 as tf

や、tensorflowのバージョン1.14へのダウングレードも試しましたがうまくいきません。

なにか改善方法を知っている方がおられましたら、回答よろしくお願いいたします。

活用しているコードは、以下のリンク先のものです。
https://github.com/yenchenlin/pix2pix-tensorflow

対象コードは、ops.pyの18行目です。

 def __call__(self, x, train=True):
        return tf.contrib.layers.batch_norm(x, decay=self.momentum, updates_collections=None, epsilon=self.epsilon, scale=True, scope=self.name)

ご教授お願い致します。

0

No Answers yet.

Your answer might help someone💌