一、查看安装的tensorflow版本
python
import tensorflow as tf
tf.__version__
查询tensorflow安装路径为:
tf.__path__
二、报错
1. TypeError: Input 'split_dim' of 'Split' Op has type float32 that does not match expected type of int32.
TensorFlow 版本不同,使用函数接口修改导致的问题。
API r1.3
tf.split
- split(
- value,
- num_or_size_splits,
- axis=0,
- num=None,
- name='split'
- )
API r0.12
tf.split
2、rnn版本问题
lstm_cell = rnn_cell.BasicLSTMCell(n_hidden, forget_bias=1.0) outputs, states = rnn.rnn(lstm_cell, x, dtype=tf.float32)
改为:
outputs, states = tf.contrib.rnn.static_rnn(lstm_cell, x, dtype=tf.float32)
(练习:image-classification-rnn-mnist-master, testing acc=0.972)