這裏是我的代碼 https://gist.github.com/Wermarter/318756a2f4cda35ebb178a932e1f8c38AttributeError的:「張量」對象有「initialized_value」沒有屬性
我試圖用TFLearn實施VAE但是編譯器說:
Traceback (most recent call last):
File "/home/wermarter/Desktop/ChienVAE_RawTF.py", line 107, in <module>
main()
File "/home/wermarter/Desktop/ChienVAE_RawTF.py", line 101, in main
vae = VAE()
File "/home/wermarter/Desktop/ChienVAE_RawTF.py", line 26, in __init__
self._build_graph()
File "/home/wermarter/Desktop/ChienVAE_RawTF.py", line 67, in _build_graph
self.training_model = tflearn.Trainer(train_ops=trainop, tensorboard_dir=TENSORBOARD_DIR)
File "/home/wermarter/anaconda3/lib/python3.5/site-packages/tflearn/helpers/trainer.py", line 131, in __init__
clip_gradients)
File "/home/wermarter/anaconda3/lib/python3.5/site-packages/tflearn/helpers/trainer.py", line 651, in initialize_training_ops
ema_num_updates=self.training_steps)
File "/home/wermarter/anaconda3/lib/python3.5/site-packages/tflearn/summaries.py", line 239, in add_loss_summaries
loss_averages_op = loss_averages.apply([loss] + other_losses)
File "/home/wermarter/anaconda3/lib/python3.5/site-packages/tensorflow/python/training/moving_averages.py", line 375, in apply
colocate_with_primary=(var.op.type in ["Variable", "VariableV2"]))
File "/home/wermarter/anaconda3/lib/python3.5/site-packages/tensorflow/python/training/slot_creator.py", line 169, in create_zeros_slot
else array_ops.shape(primary.initialized_value()))
AttributeError: 'Tensor' object has no attribute 'initialized_value'
我試着運行在github上一些例子,他們工作得很好,我想這是不是在Tensorflow錯誤或TFlearn
你有什麼TF版本?我已經運行你的腳本,我看到「ValueError:不能將部分已知的TensorShape轉換爲張量:(?,784)」我有1.0.1 –
@ S.Stas我正在使用TF 1.2.0。在1.0.1上運行時,它顯示出ValueError(?,784) –