2017-04-02 4 views
1

기능에서 발견 ValueError를 언 바운드 개체 틀은 다음있어 오류 :CNTK : 나는 CNTK 작업을하고 있어요

ValueError: 2 unbound Placeholder(s) 'Placeholder('keep', [#, *], [939]), Placeholder('keep', [#, *], [939])' found in the Function. All Placeholders of a Function must be bound (to a variable) before performing a Forward computation.

for i in range(10000): 
    a1,a2,tar=get_sample(minibatch_size,start) 
    start=start+int(minibatch_size) 
    if start>=int(0.8*float(len(lab)))-minibatch_size: 
     start=0 
    trainer.train_minibatch({P1: a1, P2: a2, target: tar}) 

P1 and P2 are defined as C.layers.Input(939)

+0

내가 유사한 오류 얻을 : ValueError를 : 언 바운드 1 자리 표시 자 ''자리 표시 자 ('유지', [???], [???])가 함수에 있습니다. 나는 이유를 알 수 없다. – CodeWarrior

답변

0

나는 그림을 수 있었다 내 경우에 문제가 생겼다. 트레이너 생성자에 매개 변수로 모델 자체 대신 모델 출력을 전달해야했습니다.

모델 cntk.layers.Sequential = ([L1 (L2)])

model_output = 모델 (예측)

에러 : 트레이너 = cntk.train.trainer.Trainer (모델 (손실 신체의 체중 측정), [학습자])

없음 오류 없습니다 : 트레이너 = cntk.train.trainer.Trainer (model_output, (손실, 신체의 체중 측정), [학습자])