tensor shape

tf.shape()

import tensorflow as tf
x = 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 tf
x = tf.constant([2,3,4,5])
shape1 = x.get_shape()
shape2 = x.get_shape().as_list()

with tf.Session() as sess:
	print(sess.run(shape1))
	print(sess.run(shape2))
recent article

tensorflow and cuda version

tensorflow各个版本需要的CUDA版本以及Cudnn的对应关系相应的网址为:tensorflow install for linux and macOStensorflow install for windows 版本 Python 版本 编译器 编译工具 cuDNN CUDA tensorflow_gpu-2.0.0-alpha0 2.7、3.3-3.6 ...…

computer science deep learning tensorflow blogread
previous article

save log file for bash output

A code example# Train and test the modelexport CUDA_VISIBLE_DEVICES=2dataset="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 --dat...…

computer science ubuntu bash blogread