Resource localhost/rnn/multi_rnn_cell/cell_2/layer_2/bias/class tensorflow::Var does not exist.

最近搭建LSTM网络,各个参数都初始化好了,但是进行参数更新时就出错
下面是出错提示
FailedPreconditionError: Error while reading resource variable rnn/multi_rnn_cell/cell_2/layer_2/bias from Container: localhost. This could mean that the variable was uninitialized. Not found: Resource localhost/rnn/multi_rnn_cell/cell_2/layer_2/bias/class tensorflow::Var does not exist.
[[node rnn/multi_rnn_cell/cell_2/layer_2/bias/Read/ReadVariableOp (defined at G:/project/LSTM/LSTM.py:65) ]]
下面是具体的代码

import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
from tensorflow.examples.tutorials.mnist import input_data
from PIL import Image
from loadData import loadData
from tensorflow.contrib import rnn
import os
tf.Graph().as_default()
img_path = r"G:/project/dataset/state-farm-distracted-driver-detection/train"

# 设置用到的参数
lr = 1e-3
# 在训练和测试的时候 想使用不同的batch_size 所以采用占位符的方式
'''
batch_size = tf.placeholder(tf.int32, [])
'''
keep_
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值