本文总结了TensorFlow在使用过程中可能遇到的错误,包括确认版本、An error ocurred while starting the kernel、InvalidArgumentError、OutOfRangeError和ResourceExhaustedError,并提供了相应的解决策略,如检查数据形状、配置、内存管理和模型简化。
确认TensorFlow是CPU版本还是GPU版本
用一个矩阵相乘的程序来确认:
import tensorflow as tf
a = tf.constant([1.0,2.0,3.0,4.0,5.0,6.0], shape=[2,3], name='a')
b = tf.constant([1.0,2.0,3.0,4.0,5.0,6.0]