日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > python >内容正文

python

python history没有定义_python AttributeError:'Tensor'对象没有属性'_keras_history'_python_酷徒编程知识库...

發布時間:2024/10/12 python 29 豆豆
生活随笔 收集整理的這篇文章主要介紹了 python history没有定义_python AttributeError:'Tensor'对象没有属性'_keras_history'_python_酷徒编程知识库... 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

我正在開發一種GAN(通用對抗網路)。Layer (type) Output Shape Param # Connected to

_____________________________________________________________________________

input_1 (InputLayer) (None, 30, 91) 0

_____________________________________________________________________________

model_1 (Model) (None, 30, 1) 12558 input_1[0][0]

_____________________________________________________________________________

model_2 (Model) (None, 30, 91) 99889 input_1[0][0]

model_1[1][0]

_____________________________________________________________________________

model_3 (Model) (None, 1) 456637 model_2[1][0]

_____________________________________________________________________________

ipretrained model_2和,問題是pretrained model_2 0和1的列表,但model_1返回值,所以我考慮了使用以下代碼對model1_output進行四捨五入:model1_out上。import keras.backend as K

[...]

def make_gan(GAN_in, model1, model2, model3):

model1_out = model1(GAN_in)

model2_out = model2([GAN_in, K.round(model1_out)])

GAN_out = model3(model2_out)

GAN = Model(GAN_in, GAN_out)

GAN.compile(loss=loss, optimizer=model1.optimizer, metrics=['binary_accuracy'])

return GAN

[...]

我有以下錯誤:

AttributeError :'Tensor'object has no attribute'_keras_history'

完全回溯:Traceback (most recent call last):

File"C:UsersAsmaaDocumentsBillyValuationGFD.py", line 88, in

GAN = make_gan(inputSentence, G, F, D)

File"C:UsersAsmaaDocumentsBillyValuationGFD.py", line 61, in make_gan

GAN = Model(GAN_in, GAN_out)

File"C:ProgramDataAnaconda3libsite-packageskeraslegacyinterfaces.py", line 88, in wrapper

return func(*args, **kwargs)

File"C:ProgramDataAnaconda3libsite-packageskerasenginetopology.py", line 1705, in __init__

build_map_of_graph(x, finished_nodes, nodes_in_progress)

File"C:ProgramDataAnaconda3libsite-packageskerasenginetopology.py", line 1695, in build_map_of_graph

layer, node_index, tensor_index)

File"C:ProgramDataAnaconda3libsite-packageskerasenginetopology.py", line 1695, in build_map_of_graph

layer, node_index, tensor_index)

File"C:ProgramDataAnaconda3libsite-packageskerasenginetopology.py", line 1665, in build_map_of_graph

layer, node_index, tensor_index = tensor._keras_history

AttributeError: 'Tensor' object has no attribute '_keras_history'

我在Windows 7上使用 Python 3.6 Spyder 3.1.4,並通過pip升級了TensorFlow和Keras。

總結

以上是生活随笔為你收集整理的python history没有定义_python AttributeError:'Tensor'对象没有属性'_keras_history'_python_酷徒编程知识库...的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。