我正在尝试使用tf.contrib.seq2seq模块对某些数据进行预测(只是float32向量),但我使用TensorFlow中的seq2seq模块找到的所有示例都用于转换和嵌入.
我很难理解tf.contrib.seq2seq.Helper究竟为Seq2Seq架构做了什么,以及如何在我的案例中使用CustomHelper.
这就是我现在所做的:
import tensorflow as tf
from tensorflow.python.layers import core as layers_core
input_seq_len = 15 # Sequence length as input
input_dim = 1 # Nb of features in input
output_seq_len = forecast_len = 20 # horizon length for forecasting
output_dim = 1 # nb of features to forecast
encoder_units = 200 # nb of units in each cell for the encoder
decoder_units = 200 # nb of units in each cell for the decoder
attention_units = 100
batch_size = …
Run Code Online (Sandbox Code Playgroud) 我目前在 tensorflow 中使用 RNN 收到此错误:
[libprotobuf FATAL google/protobuf/stubs/common.cc:61] 这个程序需要3.3.0版本的Protocol Buffer运行库,但是安装的版本是2.6.1。请更新您的库。如果您自己编译程序,请确保您的头文件来自与链接时库相同版本的 Protocol Buffers。(版本验证在“bazel-out/local_linux-opt/genfiles/tensorflow/contrib/tensor_forest/proto/fertile_stats.pb.cc”中失败。)在抛出“google::protobuf::FatalException”实例后调用终止
what():这个程序需要3.3.0版的Protocol Buffer运行库,但是安装的版本是2.6.1。请更新您的库。如果您自己编译程序,请确保您的头文件来自与链接时库相同版本的协议缓冲区。(版本验证在“bazel-out/local_linux-opt/genfiles/tensorflow/contrib/tensor_forest/proto/fertile_stats.pb.cc”中失败。)
但是当我检查版本时:
$ pip show protobuf
Name: protobuf
Version: 3.4.0
Summary: Protocol Buffers
Home-page: https://developers.google.com/protocol-buffers/
Author: protobuf@googlegroups.com
Author-email: protobuf@googlegroups.com
License: 3-Clause BSD License
Location: /usr/local/lib/python2.7/dist-packages
Requires: six, setuptools
Run Code Online (Sandbox Code Playgroud)