Tensorflow+Tutoria's solution to Wu Enda's inability to run deep learning homework

Tensorflow+Tutoria's solution to Wu Enda's inability to run deep learning homework

Welcome to this week’s programming assignment. Until now, you’ve always used numpy to build neural networks. Now we will step you through a deep learning framework that will allow you to build neural networks more easily. Machine learning frameworks like TensorFlow, PaddlePaddle, Torch, Caffe, Keras, and many others can speed up your machine learning development significantly. All of these frameworks also have a lot of documentation, which you should feel free to read. In this assignment, you will learn to do the following in TensorFlow:

reference article

https://blog.csdn.net/goryeon/article/details/102985990 Install a lower version of tensorflow
https://pypi.tuna.tsinghua.edu.cn/simple/tensorflow/ TensorFlow download address 1
https://pypi. org/project/tensorflow/#files TensorFlow download address 2
https://blog.csdn.net/weixin_45033674/article/details/103562690 The tensorflow version problem in the job

Problems encountered in the text (error reporting)

No module named 'tensorflow'
ModuleNotFoundError: No module named ‘tensorflow’
NameError: name ‘tf’ is not defined

problem lies in

TensorFlow is not installed in conda, the current direct installation will download the version after 2.0, and the higher version is not compatible with this job, some codes cannot be used

NOTE: Unusable codes:

init = tf.global_variables_initializer()      # When init is run later (session.run(init)),
                                                 # the loss variable will be initialized and ready to be computed
with tf.Session() as session:                    # Create a session and print the output
    session.run(init)                            # Initializes the variables
    print(session.run(loss))                     # Prints the loss

Solution:

If tensorflow is already installed:

View the current version pip show tensorflow
to uninstall the current version: pip uninstall tensorflow
to check that your python version number is 3.8, and then downgrade to 3.6
(I didn’t notice here that the python version limit cannot be lowered or the source problem)

Change the mirror source: Put Tsinghua Filter website on top

(Enter twice to add channels... a long list... Zhiding Tsinghua filter website)

(base) C:\Users\lenovo>conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
 
(base) C:\Users\lenovo>conda config --set show_channel_urls yes
 
(base) C:\Users\lenovo>conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
 
Warning: 'https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/' already in 'channels' list, moving to the top
Install a lower version of python (additional installation, in the base of conda, does not affect the previous version)

If you haven't installed anaconda yet, download and install it now! If it has been installed, enter the win menu to open the Anaconda prompt,
and then install the lower version of TensorFlow
insert image description here

Start with py36 version jp notebook

insert image description here

insert image description here
It's OK! Moving on to this assignment. . . .

+++++++++++++++++++++++
Update and install keras (corresponding to lower version) insert image description here
pip install keras==2.0.0

What to install less
pip install pydot
insert image description here
error message:

OSError: Unable to open file (Unable to open file: name = 'datasets/train_happy.h5', errno = 2, error message = 'no such file or directory', flags = 0, o_flags = 0)

Error message:
The original file name is wrong:
insert image description here

insert image description here

Guess you like

Origin blog.csdn.net/weixin_45673197/article/details/121066297