admin管理员组文章数量:1122852
【tensorflow
准备训练RNN-LSTM 模型,但拿到代码执行,出现好多问题,处理了一个早上终于跑通并训练了一个模型,记录并下:
1、一开始出现:vscode处于限制模式
=%257B%2522request%255Fid%2522%253A%2522165735188016782390558540%2522%252C%2522scm%2522%253A%252220140713.130102334..%2522%257D&request_id=165735188016782390558540&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~all~baidu_landing_v2~default-2-117877321-null-null.142^v32^new_blog_fixed_pos,185^v2^control&utm_term=vscode%E5%A4%84%E4%BA%8E%E9%99%90%E5%88%B6%E6%A8%A1%E5%BC%8F&spm=1018.2226.3001.4187=%257B%2522request%255Fid%2522%253A%2522165735188016782390558540%2522%252C%2522scm%2522%253A%252220140713.130102334..%2522%257D&request_id=165735188016782390558540&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~all~baidu_landing_v2~default-2-117877321-null-null.142^v32^new_blog_fixed_pos,185^v2^control&utm_term=vscode%E5%A4%84%E4%BA%8E%E9%99%90%E5%88%B6%E6%A8%A1%E5%BC%8F&spm=1018.2226.3001.4187
这篇文章帮我解决了问题;
2、后面感觉虚拟环境没选对,VS code界面与上课时有所不同,也不知道哪里出问题,
=&request_id=&biz_id=102&utm_term=VS%20CODE%E5%A6%82%E4%BD%95%E6%98%BE%E7%A4%BA%E8%99%9A%E6%8B%9F%E7%8E%AF%E5%A2%83&utm_medium=distribute.pc_search_result.none-task-blog-2~all~sobaiduweb~default-0-106533731.142^v32^new_blog_fixed_pos,185^v2^control&spm=1018.2226.3001.4187=&request_id=&biz_id=102&utm_term=VS%20CODE%E5%A6%82%E4%BD%95%E6%98%BE%E7%A4%BA%E8%99%9A%E6%8B%9F%E7%8E%AF%E5%A2%83&utm_medium=distribute.pc_search_result.none-task-blog-2~all~sobaiduweb~default-0-106533731.142^v32^new_blog_fixed_pos,185^v2^control&spm=1018.2226.3001.4187
这篇文章解决了我的困惑,最后发现VS code右下角可以切换虚拟环境
3、出现:ModuleNotFoundError: No module named 'sklearn' 错误提示
应该是缺少sklearn的库,找到这篇文章执行安装下解决
null/?ops_request_misc=&request_id=&biz_id=102&utm_term=ModuleNotFoundError:%20No%20module&utm_medium=distribute.pc_search_result.none-task-blog-2~all~sobaiduweb~default-0-106456620.142^v32^new_blog_fixed_pos,185^v2^control&spm=1018.2226.3001.4187
4、出现:FileNotFoundError: [Errno 2] No such file or directory:错误
这个问题很明显是没找到路径,但我搜索了应该有1个小时,没看出问题,后面发现原来是放D盘,不在C盘,但也找到一份好文章,分享一下
=1001.2014.3001.5506=1001.2014.3001.5506
5,遇到powershell无法执行conda的问题,虽然解决了,但不知道有啥用,记录下
=%257B%2522request%255Fid%2522%253A%2522165735306016782395386752%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fall.%2522%257D&request_id=165735306016782395386752&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~all~first_rank_ecpm_v1~rank_v31_ecpm-1-107394983-null-null.142^v32^new_blog_fixed_pos,185^v2^control&utm_term=%E6%97%A0%E6%B3%95%E5%8A%A0%E8%BD%BD%E6%96%87%E4%BB%B6%20C%3A%5CUsers%5C86137%5CDocuments%5CWindowsPowerShell%5Cprofile.ps1%EF%BC%8C%E5%9B%A0%E4%B8%BA%E5%9C%A8%E6%AD%A4%E7%B3%BB%E7%BB%9F%E4%B8%8A%E7%A6%81%E6%AD%A2%E8%BF%90%E8%A1%8C%E8%84%9A%E6%9C%AC&spm=1018.2226.3001.4187=%257B%2522request%255Fid%2522%253A%2522165735306016782395386752%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fall.%2522%257D&request_id=165735306016782395386752&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~all~first_rank_ecpm_v1~rank_v31_ecpm-1-107394983-null-null.142^v32^new_blog_fixed_pos,185^v2^control&utm_term=%E6%97%A0%E6%B3%95%E5%8A%A0%E8%BD%BD%E6%96%87%E4%BB%B6%20C%3A%5CUsers%5C86137%5CDocuments%5CWindowsPowerShell%5Cprofile.ps1%EF%BC%8C%E5%9B%A0%E4%B8%BA%E5%9C%A8%E6%AD%A4%E7%B3%BB%E7%BB%9F%E4%B8%8A%E7%A6%81%E6%AD%A2%E8%BF%90%E8%A1%8C%E8%84%9A%E6%9C%AC&spm=1018.2226.3001.4187
6、出现:TypeError: Type of `metrics` argument not understood. Expected a list or dictionary, found: mae错误提示
这个bug我整了有3个小时,搜索引擎上对于这个问题的回答很少,而且都是国外网站
在GitHub上的回答使我安装里面的内容更新了keras以及tensorflow版本,发现解决了以上的问题,但同时又出现了另外一个错误提示:AttributeError: module 'tensorflow' has no attribute 'get_default_graph',所以感觉还是tensorflow的版本有问题,下面这篇文章提示我要找关于tensorflow-keras-cuda的版本对应关系,=1001.2014.3001.5506=1001.2014.3001.5506发现我的cuda居然是11.7版本,那么tensorflow就要2.6.0版本,keras也要2.6.0版本,=1001.2014.3001.5506=1001.2014.3001.5506
更新的tensorflow的时候,还提示环境不能安装,然后activate一下,就可以装了,也不知道原理是啥,于是乎,终于跑起来了,N卡呼啦啦的响,做码农太难了
总结:
很多时候是包版本的问题,遇到bug只能勤搜索,遇到的问题越多后面处理问题越快吧。希望CSDN内容更优质。
本文标签: TensorFlow
版权声明:本文标题:【tensorflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/biancheng/1705440941a648587.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论