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:
https://blog.csdn.net/goryeon/article/details/102985990 安装低版本的tensorflow
https://pypi.tuna.tsinghua.edu.cn/simple/tensorflow/ TensorFlow下载地址1
https://pypi.org/project/tensorflow/#files TensorFlow下载地址2
https://blog.csdn.net/weixin_45033674/article/details/103562690 作业中的tensorflow版本的问题
ModuleNotFoundError: No module named ‘tensorflow’
NameError: name ‘tf’ is not defined
conda 中未安装TensorFlow,目前直接安装将会下载2.0版本之后的,而高版本对于本次作业不兼容,有些代码无法使用
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
查看目前版本pip show tensorflow
卸载目前版本:pip uninstall tensorflow
查看自己的python版本号为3.8,然后进行降级到3.6
(这里没注意是python版本限制下不了还是源的问题)
(输入两次add channels…一长串的… 置顶清华滤镜网站)
(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
若你还没有按装anaconda,赶紧下载安装吧!若已安装好,进入win菜单打开Anaconda prompt,
然后安装低版本TensorFlow
+++++++++++++++++++++++
更新 安装keras (要低版本对应)
pip install keras==2.0.0
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)