刚才要用Python运行一个神经网络的代码时,发现报错了。根据提示,发现没安装matplotlib模块。这个简单,先sudo pip install matplotlib就行。
在Ubuntu下使用matplotlib这个库时,运行时出现如下错误:
raise ImportError(str(msg) + ', please install the python3-tk package')ImportError: No module named '_tkinter', please install the python3-tk package
接着又发现有问题了。
原来Tkinter是Python的GUI widget。一般情况下Linux都没有自带,要自己安装
。
哇,惨兮兮。少了Tkinter模块。遂再安装吧。
python3安装方法:
sudo apt-get install python3-tk
python2安装方法:
sudo apt-get install python-tk
再运行一下,OK了。
OK训练完成,优化了参数后的神经网络模型。