theano编程错误及解决方法
来源:互联网 发布:php调用js函数返回值 编辑:程序博客网 时间:2024/06/08 07:15
最近在做科研过程中,用到了theano符号计算框架,我在原有程序的基础上做了改动,但程序一直报错,而theano程序又比较难调试,甚是纠结,在反复测试了好久后才弄明白,故在这里把它们记录下来,以免自己以后可能陷入同一个“坑”。
(1)错误提示“UnboundLocalError: local variable ‘e0’ referenced before assignment”;
错误样例:
import theano from theano import tensor as T sample = theano.tensor.vector() W = theano.shared([[1,2,3], [4,5,6]]) values = theano.dot(sample, W) gibbs10 = theano.function([sample], values) print(gibbs10([1,1]))
解决办法:theano.shared()函数的value属性接收numpy.array类型的初始化数据,可先把列表数据强制转换成np.array类型。
(2)错误提示“AsTensorError: (‘Variable type field must be a TensorType.’, ,
import theano from theano import tensor as T sample = theano.tensor.vector() W = theano.shared([[1,2,3], [4,5,6]]) values = T.dot(sample, W) gibbs10 = theano.function([sample], values) print(gibbs10([1,1]))
解决办法:同(1)。
(3)错误提示“CUDA driver version is insufficient for CUDA runtime version”;
错误原因:显卡驱动版本太低,不能满足CUDA运行库的版本要求;
0 0
- theano编程错误及解决方法
- socket编程错误集锦及解决方法
- ASP.net编程中遇到的错误及解决方法
- 编程过程中常见的错误及解决方法
- LINK2019错误及解决方法
- 常见错误及解决方法
- eclipse错误及解决方法
- 各种错误及解决方法
- verilog错误及解决方法
- DB2错误及解决方法
- 常见错误及解决方法
- eclipse错误及解决方法
- DB2错误及解决方法
- 415错误及解决方法
- svnmanager错误及解决方法记录
- 常见错误分析及解决方法
- MOSS2007常见错误及解决方法
- IIS7常见错误及解决方法
- layoutSubviews总结
- 养成10个优秀的习惯
- Linq 递归
- Shell学习笔记(3)
- 用js批量选中功能实现更改数据库中status状态值_优就业
- theano编程错误及解决方法
- 使用libcurl作http请求线程卡在curl_multi_perform的问题
- 什么是适配器?
- 2016-11-23知识点
- Python中类定义的讲解
- JavaScript事件详解-zepto的事件实现(二)
- 使用google authenticator(谷歌身份验证器)打造用户登录动态口令
- VS2013/MFC编程入门之三(MFC应用程序框架分析)
- python 使用unittest 测试接口