1. import tensorflow 出错
已经安装了tensorflow,但是import 还是出错
出错原因:tensorflo不支持python3.6以上版本,服务器上的python是3.7版本的
使用 pip install python=3.5
安装3.5版本的即可
2. jupyter notebook 密码忘记,改密码
jupyter notebook --generate-config
jupyter notebook password
输入新密码并确认即可
3. jupyter notebook 不支持sudo
jupyter notebook --allow-root
4. 查看cuda版本,如果已安装
vim /etc/profile
5. 用keras跑例程的时候发现concatenate总是维数对不上,查看每个输出的维度之后发现数据的channels的位置变了……
keras 的backend通常用两种tensorflow和thearo
"backend": "theano", your input_shape must be (channels, height, width)
"backend": "tensorflow", your input_shape must be (height, width, channels)
区别就在channels在前还是在后
查看keras后端配置
sudo vim $HOME/.keras/keras.json
{
"image_data_format": "channels_first",
"epsilon": 1e-07,
"backend": "tensorflow",
"floatx": "float32"
}
现在是channels_first ,一般tensorflow为backend的时候应该是channels_last.
修改image_data_format 为
{
"image_data_format": "channels_last",
"epsilon": 1e-07,
"floatx": "float32",
"backend": "tensorflow"
}