If I can help you, I'll give you some praise.
Powered by Liu Yarong-standing on the shoulders of giants
All kinds of the tyranny Python tensorflow: xxxxxx ' Module ' object has no attribute ' xxxxx '
This example is: TensorFlow, ' module ' object has no attribute ' placeholder '
My environment:
Win10x64
Anaconda 1.5
Python3.6
tensorflow1.2.1
tensorflow-gpu1.1.0 (broken computer graphics card gt610m, as if not run up Tf-gpu, just use Anaconda uninstall this package)
Problem Description:
Open command terminal, enter Python, enter Python
Enter import TensorFlow as TF
Enter A = Tf.placeholder ("float", [None, A])
Error at this time: TensorFlow, ' module ' object has no attribute ' placeholder '
Or
In the Pycharm debugging times Wrong TensorFlow, ' module ' object has no attribute ' placeholder '
Solution idea:
There are several situations that cause such problems, and I will explain to you a few of the things I know.
1, may be your project folder or the path of a named TensorFlow file or folder, and TensorFlow This module name has a conflict, system calls may call the file or folder, rather than the tensorflow you want the module. You can change that file or folder by individual name.
2, the problem is just unloaded tensorflow-gpu this place. Train of thought: first TF and TF-GPU are all good when loaded, and use the GPU to run TensorFlow, the statement used is importtensorflow as TF. After unloading the TF-GPU, it may be a problem with this tensorflow path. I also do not bother to find any path, the direct use of Anaconda to TensorFlow also uninstall, and then use anaconda Reinstall TensorFlow (Anyway, I use the CPU to run the program, the GPU is too broken) on all OK.
attached:
Module search order in Python:
1, the directory containing the input script (or the current directory without the specified file)
2, Pythonpath (a list of directory names, like the variable path syntax in the shell)
3, the default path when installing the dependency package
If I can help you, I'll give you some praise.
Powered by Liu Yarong-standing on the shoulders of giants