我正在尝试获取张量的值。
# 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)]]
我已经尝试了所有提到的方法,但它似乎不起作用。
提前致谢