小编Erl*_*ona的帖子

tensorflow static_rnn错误:输入必须是序列

我正在尝试将自己的3D数据提供给LSTM.数据具有:height = 365,width = 310,time = unknown/inconsistent,由0和1组成,产生输出的每个数据块被分隔为单个文件.

import tensorflow as tf
import os
from tensorflow.contrib import rnn

filename = "C:/Kuliah/EmotionRecognition/Train1/D2N2Sur.txt"

hm_epochs = 10
n_classes = 12
n_chunk = 443
n_hidden = 500

data = tf.placeholder(tf.bool, name='data')
cat = tf.placeholder("float", [None, n_classes])

weights = {
    'out': tf.Variable(tf.random_normal([n_hidden, n_classes]))
}
biases = {
    'out': tf.Variable(tf.random_normal([n_classes]))
}

def RNN(x, weights, biases):
    lstm_cell = rnn.BasicLSTMCell(n_hidden, forget_bias=1.0)
    outputs, states = rnn.static_rnn(lstm_cell, x, dtype=tf.float32)
    return tf.matmul(outputs[-1], weights['out']) + biases['out']

pred = RNN(data, weights, biases)

cost = …
Run Code Online (Sandbox Code Playgroud)

python lstm tensorflow rnn

3
推荐指数
1
解决办法
5390
查看次数

标签 统计

lstm ×1

python ×1

rnn ×1

tensorflow ×1