@katsuki5080

Are you sure you want to delete the question?

If your question is resolved, you may close it.

Leaving a resolved question undeleted may help others!

We hope you find it useful!

python 機械学習でエラーの直し方を教えてください。

以下のエラーが出ています。

AttributeError: module 'tensorflow.python.framework.ops' has no attribute '_TensorLike'

調べたところ、Kerasやtensorflowのバージョンによるものらしいのですが、GPUとの互換性の関係でバージョンを変更したくありません。

どうすれば改善できるでしょうか?

エラーが出ている部分はこれです。↓

from keras.datasets import mnist
from keras.layers import Dense, Flatten, Reshape
from keras.layers.advanced_activations import LeakyReLU
from keras.models import Sequential
from keras.optimizers import Adam

###省略###

def build_generator(img_shape, z_dim):

    model = Sequential()

    # Fully connected layer
    model.add(Dense(128, input_dim=z_dim))

    # Leaky ReLU activation
    model.add(LeakyReLU(alpha=0.01))

    # Output layer with tanh activation
    model.add(Dense(28 * 28 * 1, activation='tanh'))

    # Reshape the Generator output to image dimensions
    model.add(Reshape(img_shape))

    return model

回答お願いします。

1 likes

No Answers yet.

Your answer might help someone💌