Problems encountered during the use of tensorflow

1. Coexistence of py2 and py3: http://blog.csdn.net/infin1te/article/details/50445217
Be sure to use this coexistence method, and another coexistence method is to rename python.exe after installing python3, which will cause jupyter to not work properly.

2. To install tensorflow, use the following command:
pip install --ignore-installed --upgrade tensorflow If you encounter a permission denied error, restart the computer.

3. When the following error is reported when the program runs, open the...\site-packages\tensorflow\python\platform\app.py file, and change the 124 lines of code _sys.exit(main(argv)) to main(argv), This modification was unsuccessful. to be solved? ? ? If anyone knows how to solve it, please leave a message! Thanks!

tensorflow version: 1.5.0

 

4. If you want to write the activation function for each layer as a list, and call each one in a loop, when there is None in the middle, you cannot directly actList[-1] to act on a thing, and the whole formula will become None.

Such as:

actList = [tf.nn.relu, tf.nn.relu, None]

You can directly actList[i](tf.matmul(layer_i,weights)+biases) before, but the last layer cannot be written like this, you need to judge:

    if actList[-1] != None:
        output = actList[-1](tf.matmul(layer_i,weights)+biases)
    else:

        output = tf.matmul(layer_i,weights)+biases

This is the correct way to open it! ! !

I have been working on this bug for a long time, the accuracy has not been improved, it has been nan, and the parameter adjustment has no effect. Finally found out it was the problem! ! !

2018-04-24 16:30

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325806694&siteId=291194637