1. 程式人生 > >Tensorflow - setting an array element with a sequence.

Tensorflow - setting an array element with a sequence.

File "C:\Users\GAOYAN\Anaconda2\envs\python35\lib\site-packages\tensorflow\python\framework\tensor_util.py", line 416, in make_tensor_proto
    nparray = values.astype(dtype.as_numpy_dtype)
ValueError: setting an array element with a sequence.

這個錯誤是由於輸入到tensor中的batch也好,或者隨機值也好,在轉成Tensor的時候需要列對其,也就是不能輸入不定長的陣列,因此對於不定長的陣列需要進行填充操作