我想要得到張量的值。打印出來的如何評估變量?
# First Layer
encoder_layer1 = tflearn.fully_connected(x,41,activation='relu',bias=True)
layer1_weights = encoder_layer1.W
layer1_bias = encoder_layer1.b
結果是:
The layer 1 weights are: <tf.Variable 'FullyConnected/W:0' shape=(41, 41) dtype=float32_ref>
即使eval()函數似乎不工作。它會拋出一個錯誤
tensorflow.python.framework.errors_impl.FailedPreconditionError: Attempting to use uninitialized value FullyConnected/W
[[Node: _send_FullyConnected/W_0 = _Send[T=DT_FLOAT, client_terminated=true, recv_device="/job:localhost/replica:0/task:0/cpu:0", send_device="/job:localhost/replica:0/task:0/cpu:0", send_device_incarnation=-6055748491062458677, tensor_name="FullyConnected/W:0", _device="/job:localhost/replica:0/task:0/cpu:0"](FullyConnected/W)]]
我試過所有的方法提出,但它似乎並沒有工作。
在此先感謝
[如何在TensorFlow中打印張量對象的值?](http://stackoverflow.com/questions/33633370/how-to-print-the-value-of-張量 - 張量中的物體) –
問題已解決!感謝您指出 –