【问题标题】:How to resolve this ValueError in theano?如何在 theano 中解决这个 ValueError?
【发布时间】:2017-06-16 07:52:30
【问题描述】:

我在我的 python 脚本中定义了一个函数 funA(x)。这个函数运行一个基于 theano 的神经网络。如果我调用它一次,代码运行良好。但是,如果我尝试在循环中使用不同的输入多次调用它,例如: 对于范围内的 i (4): 乐趣A(x[i]) 当i=0时,代码运行良好,但是当运行到i=1时,代码报错: ValueError: 无法计算测试值:输入 0 (x) of Op dot(x, W) 缺少默认值。

我已经安装了 pymc3 并尝试将 theano.config.compute_test_value 设置回 'ignore',如以下链接所示,但失败了 PyMC3 & Theano - Theano code that works stop working after pymc3 import

下面的另一个链接说,我可以尝试删除 .theano 目录,但我使用的是 windows 版本的 theano,我在哪里可以找到 .theano 目录? https://github.com/Theano/Theano/issues/1439

提前谢谢你

【问题讨论】:

    标签: theano pymc3


    【解决方案1】:

    好消息:pymc3 的下一个版本将不再自行更改任何 theano 设置,因此错误来源有望成为过去。

    要清理你的 theano 缓存,你可以使用 theano-cache purge

    【讨论】:

    • 很高兴听到这个消息,@aseyboldt,但只是想知道这是否已经在 PyMC3 的主分支中进行了修补?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-03-07
    • 2020-12-16
    • 1970-01-01
    • 2019-09-20
    • 2020-08-01
    • 1970-01-01
    相关资源
    最近更新 更多