草庐IT

IndexedSlices

全部标签

python - 如何处理UserWarning : Converting sparse IndexedSlices to a dense Tensor of unknown shape

我在Tensorflow中收到以下警告:UserWarning:ConvertingsparseIndexedSlicestoadenseTensorofunknownshape。这可能会消耗大量内存。我得到这个的原因是:importtensorflowastf#Flattenbatchelementstorank-2tensorwhere1stmax_lengthrows#belongtofirstbatchelementandsoforthall_timesteps=tf.reshape(raw_output,[-1,n_dim])#(batch_size*max_length,n