Open dfalbel opened 6 years ago
I think your custom model function is defined problematically. The ValueError happens in sigmoid_cross_entropy()
, which means you are passing None values to it. Try defining your model function more carefully using mode
and calculate/return only the things that are valid for that particular mode.
Suppose I need to do downsampling in each batch during training. Since I can't create all batches before start training I created an input function like this:
And I was able to train the following model:
Now, I want to create predictions, and I created an special input_fn for prediction like this:
And It gives me the following error:
I'm sure I'm doing something wrong, but what's the recommended approach to this problem? I think this will be a common thing to do, since negative sampling methods (like the one used in word2vec) are also very used!
I tried using the
input_fn
but had an error too. For example, I called:But got: