写在前面的话
- 最近tensorflow 安装完后测试了一下没有问题,准备用vscode进行安装。然后配置了文件
- 首选项-> 设置
"python.pythonPath": "C:\\Users\\lyy08\\Anaconda3\\envs\\tensorflow\\python.exe",
"python.autoComplete.extraPaths": [
"C:\\Users\\lyy08\\Anaconda3\\envs\\tensorflow",
"C:\\Users\\lyy08\\Anaconda3\\envs\\tensorflow\\Lib\\site-packages"
],
"workbench.statusBar.visible": true,
"files.autoGuessEncoding": true,
"python.autoComplete.addBrackets": true,
"python.autoComplete.preloadModules": [
"tensorflow"
],
"python.linting.pep8Enabled": true,
"python.linting.pylintArgs": ["--load-plugins", "pylint_django"],
"python.linting.pep8Args": ["--ignore=E303"],
"editor.fontSize": 18,
"terminal.integrated.rendererType": "dom"
然后运行得到标题错误,尝试了如下的几种办法
-
重装 参考https://stackoverflow.com/questions/37383812/tensorflow-module-object-has-no-attribute-placeholder
-
是不是tensorflow.py文件冲突,查找了一下envs文件下只有一个。 然后进命令行验证一下发现正常
-
放弃了这个想法,后来无意看到了一个解决方案
于是改一下文件名为tf.py