第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

Keras 中的串聯(lián)層

Keras 中的串聯(lián)層

PHP
千萬里不及你 2023-11-09 15:52:15
我正在嘗試接受 2 個(gè)輸入到我的模型中。但它有一個(gè)奇怪的問題。x1= layers.Input((20000,))x2= layers.Reshape((200,100), input_shape=(20000,))(x1)y1= layers.Input((200000,))y2= layers.Reshape((2000,100), input_shape=(200000,))(y1)combine = layers.Concatenate(axis=1)([x2, y2])model = tf.keras.Model(inputs=[x1, y1], outputs=combine)model.predict([datasetA, datasetB])如果我接受一個(gè)輸入,模型就可以運(yùn)行。model = tf.keras.Model(inputs=[x1], output=x2)model.predict(datasetA)但如果我接受兩個(gè)輸入,模型就死了。Failed to find data adapter that can handle input: (<class 'list'> containing values of types {"<class 'tensorflow.python.data.ops.dataset_ops.PrefetchDataset'>"}), <class 'NoneType'>即我的數(shù)據(jù)集的結(jié)構(gòu)是:<PrefetchDataset shapes: ((None, 20000), (None,)), types: (tf.int64, tf.int32)>1 Dataset -> 5 Batche_data and 5 batch_LabelEach Batch_data -> 3 recordsEach record -> [20000]Each batch_Label -> 3 recordsEach label -> 0 / 1 for classification我該如何解決這個(gè)問題?
查看完整描述

2 回答

?
揚(yáng)帆大魚

TA貢獻(xiàn)1799條經(jīng)驗(yàn) 獲得超9個(gè)贊

好的,所以我找到了答案,一切都很簡(jiǎn)單。在自然狀態(tài)下,它僅返回 140 個(gè)字符,因此而不是

statuses = api.user_timeline(id=462886126)    print(statuses[0].text)

我只需要:

statuses = api.user_timeline(id=462886126, tweet_mode='extended')    print(statuses[2].full_text)


查看完整回答
反對(duì) 回復(fù) 2023-11-09
?
慕哥9229398

TA貢獻(xiàn)1877條經(jīng)驗(yàn) 獲得超6個(gè)贊

您用于tensoflow.keras導(dǎo)入圖層嗎?唯一可能出現(xiàn)model.summary 問題的是您通過模型的形狀。


這段代碼工作正常。張量流==2.0.0


import tensorflow as tf

import numpy as np


datasetA = np.zeros((10,20000),dtype=int)

datasetB = np.zeros((10,200000),dtype=int)


x1= tf.keras.layers.Input((20000,))

x2= tf.keras.layers.Reshape((200,100), input_shape=(20000,))(x1)


y1= tf.keras.layers.Input((200000,))

y2= tf.keras.layers.Reshape((2000,100), input_shape=(200000,))(y1)


combine = tf.keras.layers.Concatenate(axis=1)([x2, y2])

model = tf.keras.Model(inputs=[x1, y1], outputs=combine)

model.summary()

model.predict([datasetA, datasetB])

print('the predict done')], outputs=combine)


查看完整回答
反對(duì) 回復(fù) 2023-11-09
  • 2 回答
  • 0 關(guān)注
  • 143 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)