save log file for bash output

A code example

# Train and test the model
export CUDA_VISIBLE_DEVICES=2
dataset="xxx"
LOG="./caches/$dataset.txt.`date +'%Y-%m-%d_%H-%M-%S'`"
exec &> >(tee -a "$LOG")
echo Logging output to "$LOG"
echo 'Train the model ...'
python train.py --dataset $dataset
recent article

tensor shape

tf.shape()import tensorflow as tfx = tf.constant([2,3,4,5])shape = tf.shape(x)with tf.Session() as sess: print(sess.run(shape))tensor.get_shape().as_list()import tensorflow as tfx = tf.constant([2,3,4,5])shape1 = x.get_shape()shape2 = x.get_shape(...…

computer science deep learning tensorflow blogread
previous article

open for Python

Python open() 函数python open()函数用于打开一个文件,创建一个 file 对象,相关的方法才可以调用它进行读写。更多文件操作可参考:Python 文件I/O。function grammaropen(name[, mode[, buffering]])name: 一个包含了你要访问的文件名称的字符串值。mode: mode 决定了打开文件的模式:只读,写入,追加等。所有可取值见如下的完全列表。这个参数是非强制的,默认文件访问模式为只读(r)。buffering: ...…

computer science deep learning python blogread