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

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

報(bào)錯(cuò)Attempted to use a closed Session.是怎么回事呀

我的session應(yīng)該是正常的呀

x?=?tf.compat.v1.placeholder('float',?[None,?784])
sess?=?tf.Session()


#取出線性回歸方法
with?tf.variable_scope('regression'):
????y1,?variables?=?model.regression(x)

saver?=?tf.train.Saver(variables)
saver.restore(sess,?'mnist/data/regression.ckpt')

#取出訓(xùn)練好的卷積的模型
with?tf.variable_scope('convolutionoal'):
????keep_prob?=?tf.placeholder('float')
????y2,?variables?=?model.convolutional(x,?keep_prob)

saver?=?tf.train.Saver(variables)
#saver.restore(sess,?"mnist/data/convalutional.ckpt")
#tf.train.latest_checkpoint('mnist/data/convalutional.ckpt')
module_file?=??tf.train.latest_checkpoint('mnist/data/convolutional.ckpt')
with?tf.Session()?as?sess:
???sess.run(tf.global_variables_initializer())
???if?module_file?is?not?None:
??????saver.restore(sess,?module_file)

#定義輸入??線性
def?regression(input):
????return?sess.run(y1,?feed_dict={x:?input}).flatten().tolist()
#定義輸入???卷積
def?convolutional(input):
????return?sess.run(y2,?feed_dict={x:?input,?keep_prob:?1.0}).flatten().tolist()


正在回答

1 回答

0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消

報(bào)錯(cuò)Attempted to use a closed Session.是怎么回事呀

我要回答 關(guān)注問(wèn)題
微信客服

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

幫助反饋 APP下載

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

公眾號(hào)

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