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

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

使用池的 Tensorflow 錯誤:無法pickle _thread.RLock 對象

使用池的 Tensorflow 錯誤:無法pickle _thread.RLock 對象

森林海 2021-09-25 16:25:19
我試圖在 Tensorflow CPU 上實現(xiàn)大規(guī)模并行微分方程求解器(30k DE),但內(nèi)存不足(大約 30GB 矩陣)。所以我實現(xiàn)了一個基于批處理的求解器(在短時間內(nèi)求解并保存數(shù)據(jù) -> 設(shè)置新的初始值 -> 再次求解)。但問題仍然存在。我了解到在關(guān)閉 python 解釋器之前,Tensorflow 不會清除內(nèi)存。因此,基于有關(guān) github 問題的信息,我嘗試使用池實現(xiàn)多處理解決方案,但在池化步驟中我不斷收到“無法腌制 _thread.RLock 對象”。有人可以幫忙嗎!def dAdt(X,t):  dX = // vector of differential  return dXglobal state_vectorglobal statestate_vector =  [0]*n // initial statedef tensor_process():    with tf.Session() as sess:        print("Session started...",end="")        tf.global_variables_initializer().run()        state = sess.run(tensor_state)        sess.close()n_batch = 3t_batch = np.array_split(t,n_batch)for n,i in enumerate(t_batch):    print("Batch",(n+1),"Running...",end="")    if n>0:        i = np.append(i[0]-0.01,i)    print("Session started...",end="")    init_state = tf.constant(state_vector, dtype=tf.float64)    tensor_state = tf.contrib.odeint_fixed(dAdt, init_state, i)    with Pool(1) as p:        p.apply_async(tensor_process).get()    state_vector = state[-1,:]    np.save("state.batch"+str(n+1),state)    state=None
查看完整描述

3 回答

  • 3 回答
  • 0 關(guān)注
  • 382 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號

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