2017-09-05 22 views
0

林的預測無法使用下面的代碼來養活張

roi = frame[t_y:t_y + t_h, t_x:t_x + t_w] 


predictions = sess.run(classification_tensor, feed_dict={'age_model/input_1:0': roi}) 

然而即時得到下面的錯誤,

Traceback (most recent call last): 
    File "C:/Users/R&D/Documents/Maxis_2/Maxis/src/dwell_time_maxis.py", line 207, in <module> 
    predictions = sess.run(age_tensor, feed_dict={'age_model/input_1:0': roi}) 
    File "C:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 789, in run 
    run_metadata_ptr) 
    File "C:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 975, in _run 
    % (np_val.shape, subfeed_t.name, str(subfeed_t.get_shape()))) 
ValueError: Cannot feed value of shape (64, 64, 3) for Tensor 'age_model/input_1:0', which has shape '(?, 64, 64, 3)' . 

雖然我也調整爲64x64x3,林仍然得到這個錯誤。爲什麼這樣?

+0

你嘗試'feed_dict = { 'age_model/INPUT_1:0':投資回報率[無]}'? – Psidom

+0

讓我試試看吧...... –

+0

它發射的是同樣的錯誤 –

回答

1

問題是,您將三維值輸入到四維值(即使元素數量相同)。

只是重塑你的飼料:

roi = np.reshape(roi, [1,64,64,3])